BatchWriteItemRequest batchRequest = new BatchWriteItemRequest();
Map<String, List<WriteRequest>> itemRequests = new HashMap<String, List<WriteRequest>>();
itemRequests.put(MetastoreJanitor.tableName, batch);
batchRequest.setRequestItems(itemRequests);
BatchWriteItemResult result = db.batchWriteItem(batchRequest);
//Resubmit failed writes
for (Map.Entry<String, List<WriteRequest>> e : result.getUnprocessedItems().entrySet()) {
for (WriteRequest w : e.getValue()) {
deleteQueue.put(w.getDeleteRequest().getKey());
}
}
//Drain capacity
for (Map.Entry<String, BatchWriteResponse> e : result.getResponses().entrySet()) {
limiter.acquire(e.getValue().getConsumedCapacityUnits().intValue());
}
if(log.isDebugEnabled()) {
log.debug(String.format("delete: %2d, queue_size: %5d, max_rate: %4.1f", keys.size(), deleteQueue.size(), limiter.getRate()));