I am trying to do a full scan on a dynamoDB tables. This is the code I am using:
private void fetchItems(AmazonDynamoDBClient client) {
int count = 0;
ScanResult result = null;
ScanRequest req = new ScanRequest();
req.setTableName(this.tableName);
do {
if (result != null) {
req.setExclusiveStartKey(result.getLastEvaluatedKey());
}
result = client.scan(req);
List<Map<String, AttributeValue>> rows = result.getItems();
count += rows.size();
} while(result.getLastEvaluatedKey() != null);
System.out.println("Result size: " + count);
}
}
The problem is that this functions returns 207 of the 273 items that are in the table. I have checked the metrics and there has been no throttling of requests. What could be the reason for this incomplete result ?
The problem was that I was looking at the wrong region. The table I was reading from was in NA while I was looking at the EU one. Thanks to @Chris for this.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.