Example usage for com.amazonaws.services.dynamodbv2.model UpdateItemRequest getExpressionAttributeValues

List of usage examples for com.amazonaws.services.dynamodbv2.model UpdateItemRequest getExpressionAttributeValues

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.model UpdateItemRequest getExpressionAttributeValues.

Prototype


public java.util.Map<String, AttributeValue> getExpressionAttributeValues() 

Source Link

Document

One or more values that can be substituted in an expression.

Usage

From source file:com.amazon.janusgraph.diskstorage.dynamodb.DynamoDbDelegate.java

License:Open Source License

/**
 * This method calculates a lower bound of the size of a new item created with UpdateItem UpdateExpression. It does not
 * account for the size of the attribute names of the document paths in the attribute names map and it assumes that the
 * UpdateExpression only uses the SET action to assign to top-level attributes.
 * @param request UpdateItem request that uses update expressions
 * @return the size of the post-update image of the item
 *//*from w  ww  .j  a v a 2 s .c  o  m*/
private int calculateExpressionBasedUpdateSize(final UpdateItemRequest request) {
    if (request == null || request.getUpdateExpression() == null) {
        throw new IllegalArgumentException("request did not use update expression");
    }
    int size = calculateItemSizeInBytes(request.getKey());
    for (AttributeValue value : request.getExpressionAttributeValues().values()) {
        size += calculateAttributeSizeInBytes(value);
    }
    return size;
}

From source file:com.rapid7.diskstorage.dynamodb.DynamoDBDelegate.java

License:Open Source License

/**
 * This method calculates a lower bound of the size of a new item created with UpdateItem UpdateExpression. It does not
 * account for the size of the attribute names of the document paths in the attribute names map and it assumes that the
 * UpdateExpression only uses the SET action to assign to top-level attributes.
 * @param request UpdateItem request that uses update expressions
 * @return the size of the post-update image of the item
 *///from   w  w w. ja  v  a  2  s  .c  om
private int calculateExpressionBasedUpdateSize(UpdateItemRequest request) {
    if (request == null || request.getUpdateExpression() == null) {
        throw new IllegalArgumentException("request did not use update expression");
    }
    int size = calculateItemSizeInBytes(request.getKey());
    for (AttributeValue value : request.getExpressionAttributeValues().values()) {
        size += calculateAttributeSizeInBytes(value);
    }
    return size;
}