return sb.toString();
}
public static <V> List<V> executeOperation(OperationFactory operationFactory, MapReduceService mapReduceService,
NodeEngine nodeEngine, boolean returnsResponse) {
ClusterService cs = nodeEngine.getClusterService();
OperationService os = nodeEngine.getOperationService();
Collection<MemberImpl> members = cs.getMemberList();
List<V> results = returnsResponse ? new ArrayList<V>() : null;
List<Exception> exceptions = new ArrayList<Exception>(members.size());
for (MemberImpl member : members) {
try {
Operation operation = operationFactory.createOperation();
if (cs.getThisAddress().equals(member.getAddress())) {
// Locally we can call the operation directly
operation.setNodeEngine(nodeEngine);
operation.setCallerUuid(nodeEngine.getLocalMember().getUuid());
operation.setService(mapReduceService);
operation.run();