protected final void accumulateStats(ConsumedCapacity consumedCapacity,
Integer count, Integer scannedCount) {
if (consumedCapacity != null) {
if (totalConsumedCapacity == null) {
// Create a new consumed capacity by cloning the one passed in
this.totalConsumedCapacity = new ConsumedCapacity();
totalConsumedCapacity.setCapacityUnits(consumedCapacity.getCapacityUnits());
totalConsumedCapacity.setGlobalSecondaryIndexes(
clone(consumedCapacity.getGlobalSecondaryIndexes()));
totalConsumedCapacity.setLocalSecondaryIndexes(
clone(consumedCapacity.getLocalSecondaryIndexes()));