.withTableName(tableName) .withConsistentRead(isConsistentRead) .withIndexName(this.indexName);
.withSelect(Select.COUNT) .withConsistentRead(isConsistentRead) .withIndexName(this.indexName);
Condition hashKeyCondition = new Condition(); hashKeyCondition.withComparisonOperator(ComparisonOperator.EQ).withAttributeValueList(new AttributeValue().withS(hashKeyAttributeValue)); Condition rangeKeyCondition = new Condition(); rangeKeyCondition.withComparisonOperator(ComparisonOperator.GT).withAttributeValueList(new AttributeValue().withN(timestamp.toString())); Map<String, Condition> keyConditions = new HashMap<String, Condition>(); keyConditions.put(MappedItem.INDEXED_ATTRIBUTE_NAME, hashKeyCondition); keyConditions.put(MappedItem.TIMESTAMP, rangeKeyCondition); QueryRequest queryRequest = new QueryRequest(); queryRequest.withTableName(tableName); queryRequest.withIndexName(MappedItem.INDEX_NAME); queryRequest.withKeyConditions(keyConditions); QueryResult result = amazonDynamoDBClient.query(queryRequest); List<MappedItem> mappedItems = new ArrayList<MappedItem>(); for(Map<String, AttributeValue> item : result.getItems()) { MappedItem mappedItem = dynamoDBMapper.marshallIntoObject(MappedItem.class, item); mappedItems.add(mappedItem); } return mappedItems;
.put(DynamoDataStore.SCATTER_PREFIX_ATTRIBUTE, c); QueryRequest req = new QueryRequest() .withIndexName(this.indexName) .withTableName(this.tableName) .withKeyConditions(this.conditions);
.withIndexName(indexName) .withScanIndexForward(true);
request = request.withIndexName(this.index);
request = request.withIndexName(this.index);
.withIndexName(config.getGeohashIndexName()).withConsistentRead(true) .withReturnConsumedCapacity(ReturnConsumedCapacity.TOTAL).withExclusiveStartKey(lastEvaluatedKey);
.withLimit(Integer.MAX_VALUE); if (!this.index.isEmpty()) { request = request.withIndexName(this.index);
.withLimit(Integer.MAX_VALUE); if (!this.index.isEmpty()) { request = request.withIndexName(this.index);
public static QueryRequest copyQueryRequest(QueryRequest queryRequest) { QueryRequest copiedQueryRequest = new QueryRequest().withAttributesToGet(queryRequest.getAttributesToGet()) .withConsistentRead(queryRequest.getConsistentRead()) .withExclusiveStartKey(queryRequest.getExclusiveStartKey()).withIndexName(queryRequest.getIndexName()) .withKeyConditions(queryRequest.getKeyConditions()).withLimit(queryRequest.getLimit()) .withReturnConsumedCapacity(queryRequest.getReturnConsumedCapacity()) .withScanIndexForward(queryRequest.getScanIndexForward()).withSelect(queryRequest.getSelect()) .withTableName(queryRequest.getTableName()); return copiedQueryRequest; } }