int totalRequestedBackupCount = requestedSyncBackupCount + requestedAsyncBackupCount;
if (totalRequestedBackupCount == 0) {
return 0;
}
Operation op = (Operation) backupAwareOp;
InternalPartitionService partitionService = node.getPartitionService();
long[] replicaVersions = partitionService.incrementPartitionReplicaVersions(op.getPartitionId(),
totalRequestedBackupCount);
int maxPossibleBackupCount = min(partitionService.getMemberGroupsSize() - 1,
InternalPartition.MAX_BACKUP_COUNT);
int syncBackupCount = min(maxPossibleBackupCount, requestedSyncBackupCount);
int asyncBackupCount = min(maxPossibleBackupCount - syncBackupCount, requestedAsyncBackupCount);
int totalBackupCount = syncBackupCount + asyncBackupCount;
if (totalBackupCount == 0) {
return 0;
}
if (!op.returnsResponse()) {
syncBackupCount = 0;
}
return makeBackups(backupAwareOp, op.getPartitionId(), replicaVersions, syncBackupCount, totalBackupCount);
}