in sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/providers/store/MetaStore.java [177:198]
public long getMaxVersion(final String materialName) {
final List<Map<String, AttributeValue>> items =
ddb.query(
new QueryRequest()
.withTableName(tableName)
.withConsistentRead(Boolean.TRUE)
.withKeyConditions(
Collections.singletonMap(
DEFAULT_HASH_KEY,
new Condition()
.withComparisonOperator(ComparisonOperator.EQ)
.withAttributeValueList(new AttributeValue().withS(materialName))))
.withLimit(1)
.withScanIndexForward(false)
.withAttributesToGet(DEFAULT_RANGE_KEY))
.getItems();
if (items.isEmpty()) {
return -1L;
} else {
return Long.parseLong(items.get(0).get(DEFAULT_RANGE_KEY).getN());
}
}