Source:
private Object handleLocalPutMapCommand(InvocationContext ctx, PutMapCommand command) { final CacheTopology cacheTopology = checkTopologyId(command); final ConsistentHash consistentHash = cacheTopology.getWriteConsistentHash(); final PrimaryOwnerClassifier filter = new PrimaryOwnerClassifier(consistentHash, command.getMap().size()); final boolean sync = isSynchronous(command); final VisitableCommand.LoadType loadType = command.loadType(); command.getMap().entrySet().forEach(filter::add); if (sync) { commandAckCollector .createMultiKeyCollector(command.getCommandInvocationId().getId(), filter.primaries.keySet(), filter.backups, command.getTopologyId(), timeoutNanos); final Map<Object, Object> localEntries = filter.primaries.remove(localAddress); forwardToPrimaryOwners(command, filter); if (localEntries != null) { sendToBackups(command, localEntries, consistentHash); CompletableFuture<?> remoteGet = checkRemoteGetIfNeeded(ctx, command, localEntries.keySet(), consistentHash, loadType == PRIMARY || loadType == OWNER); return makeStage(asyncInvokeNext(ctx, command, remoteGet)) .andFinally(ctx, command, onPutMapWithLocalEntries); } return invokeNextAndExceptionally(ctx, command, onPutMapNoLocalEntriesException); } final Map<Object, Object> localEntries = filter.primaries.remove(localAddress); forwardToPrimaryOwners(command, filter); if (localEntries != null) { sendToBackups(command, localEntries, consistentHash); return asyncInvokeNext(ctx, command, checkRemoteGetIfNeeded(ctx, command, localEntries.keySet(), consistentHash, loadType == PRIMARY || loadType == OWNER)); } return invokeNext(ctx, command); }

Target:
private Object handleLocalPutMapCommand(InvocationContext ctx, PutMapCommand command) { final CacheTopology cacheTopology = checkTopologyId(command); final ConsistentHash consistentHash = cacheTopology.getWriteConsistentHash(); final PrimaryOwnerClassifier filter = new PrimaryOwnerClassifier(consistentHash, command.getMap().size()); final boolean sync = isSynchronous(command); final VisitableCommand.LoadType loadType = command.loadType(); command.getMap().entrySet().forEach(filter::add); if (sync) { commandAckCollector .createMultiKeyCollector(command.getCommandInvocationId().getId(), filter.primaries.keySet(), filter.backups, command.getTopologyId()); final Map<Object, Object> localEntries = filter.primaries.remove(localAddress); forwardToPrimaryOwners(command, filter); if (localEntries != null) { sendToBackups(command, localEntries, consistentHash); CompletableFuture<?> remoteGet = checkRemoteGetIfNeeded(ctx, command, localEntries.keySet(), consistentHash, loadType == PRIMARY || loadType == OWNER); return makeStage(asyncInvokeNext(ctx, command, remoteGet)) .andFinally(ctx, command, onPutMapWithLocalEntries); } return invokeNextAndExceptionally(ctx, command, onPutMapNoLocalEntriesException); } final Map<Object, Object> localEntries = filter.primaries.remove(localAddress); forwardToPrimaryOwners(command, filter); if (localEntries != null) { sendToBackups(command, localEntries, consistentHash); return asyncInvokeNext(ctx, command, checkRemoteGetIfNeeded(ctx, command, localEntries.keySet(), consistentHash, loadType == PRIMARY || loadType == OWNER)); } return invokeNext(ctx, command); }