private void sendResponse() { Object[] results = new Object[partitions.length]; for (int k = 0; k < partitions.length; k++) { int partitionId = partitions[k]; Object response = responseArray.get(partitionId); results[k] = response == NULL ? null : response; } PartitionIteratingOperation.this.sendResponse(new PartitionResponse(partitions, results)); } }
private void sendResponse() { Object[] results = new Object[partitions.length]; for (int k = 0; k < partitions.length; k++) { int partitionId = partitions[k]; Object response = responseArray.get(partitionId); results[k] = response == NULL ? null : response; } PartitionIteratingOperation.this.sendResponse(new PartitionResponse(partitions, results)); } }
@Override public void start() { if (partitions.length == 0) { // partitions may be empty if the node has joined and didn't get any partitions yet // a generic operation may already execute on it. sendResponse(EMPTY_RESPONSE); return; } PartitionAwareOperationFactory partitionAwareFactory = extractPartitionAware(operationFactory); if (partitionAwareFactory == null) { executeOperations(); } else { executeOperations(partitionAwareFactory); } }
@Override public void start() { if (partitions.length == 0) { // partitions may be empty if the node has joined and didn't get any partitions yet // a generic operation may already execute on it. sendResponse(EMPTY_RESPONSE); return; } PartitionAwareOperationFactory partitionAwareFactory = extractPartitionAware(operationFactory); if (partitionAwareFactory == null) { executeOperations(); } else { executeOperations(partitionAwareFactory); } }
@Override public void onExecutionFailure(Throwable cause) { // we also send a response so that the caller doesn't wait indefinitely. sendResponse(new ErrorResponse(cause, getCallId(), isUrgent())); getLogger().severe(cause); }
@Override public void onExecutionFailure(Throwable cause) { // we also send a response so that the caller doesn't wait indefinitely. sendResponse(new ErrorResponse(cause, getCallId(), isUrgent())); getLogger().severe(cause); }