scanTable(List attributesToGet) { List<> allRows = new LinkedList<>(); ScanResult result = null; do{ ScanRequest scanRequest = new ScanRequest().withTableName(this.tableName).withAttributesToGet(attributesToGet); if(result != null){ scanRequest.setExclusiveStartKey(result.getLastEvaluatedKey()); } long time = System.currentTimeMillis(); result = this.client.scan(scanRequest); allRows.addAll(result.getItems()); log.info("scan in: " + (System.currentTimeMillis() - time) + " ms"); } while(result.getLastEvaluatedKey() != null); return allRows; }
Tuesday, September 30, 2014
How to fetch all results from DynamoDB
Posted by
Dinesh Wijekoon
at
12:55 PM
Dynamo DB simple scan will not give you all the results.
Subscribe to:
Post Comments (Atom)
1 comment:
Great things you've always shared with us.
12th arts result
Post a Comment