use of com.hazelcast.core.Member in project hazelcast by hazelcast.
the class ClientExecutorServiceProxy method submitToMembers.
@Override
public void submitToMembers(Runnable command, Collection<Member> members, MultiExecutionCallback callback) {
Callable<?> callable = createRunnableAdapter(command);
MultiExecutionCallbackWrapper multiExecutionCallbackWrapper = new MultiExecutionCallbackWrapper(members.size(), callback);
for (Member member : members) {
final ExecutionCallbackWrapper executionCallback = new ExecutionCallbackWrapper(multiExecutionCallbackWrapper, member);
submitToMember(callable, member, executionCallback);
}
}
use of com.hazelcast.core.Member in project hazelcast by hazelcast.
the class ClientExecutorServiceProxy method submitToAllMembers.
@Override
public <T> void submitToAllMembers(Callable<T> task, MultiExecutionCallback callback) {
final Collection<Member> memberList = getContext().getClusterService().getMemberList();
MultiExecutionCallbackWrapper multiExecutionCallbackWrapper = new MultiExecutionCallbackWrapper(memberList.size(), callback);
for (Member member : memberList) {
final ExecutionCallbackWrapper<T> executionCallback = new ExecutionCallbackWrapper<T>(multiExecutionCallbackWrapper, member);
submitToMember(task, member, executionCallback);
}
}
use of com.hazelcast.core.Member in project hazelcast by hazelcast.
the class QueryDispatcher method dispatchFullQueryOnAllMembersOnQueryThread.
private List<Future<Result>> dispatchFullQueryOnAllMembersOnQueryThread(Query query) {
Collection<Member> members = clusterService.getMembers(DATA_MEMBER_SELECTOR);
List<Future<Result>> futures = new ArrayList<Future<Result>>(members.size());
for (Member member : members) {
Operation operation = new QueryOperation(query);
Future<Result> future = operationService.invokeOnTarget(MapService.SERVICE_NAME, operation, member.getAddress());
futures.add(future);
}
return futures;
}
use of com.hazelcast.core.Member in project hazelcast by hazelcast.
the class NodeQueryCacheEndToEndConstructor method createPublishersAndGetQueryResults.
private Collection<QueryResult> createPublishersAndGetQueryResults(AccumulatorInfo info) {
InvokerWrapper invokerWrapper = context.getInvokerWrapper();
Collection<Member> members = context.getMemberList();
List<Future<QueryResult>> futures = new ArrayList<Future<QueryResult>>(members.size());
for (Member member : members) {
Address address = member.getAddress();
Future future = invokerWrapper.invokeOnTarget(new PublisherCreateOperation(info), address);
futures.add(future);
}
return returnWithDeadline(futures, OPERATION_WAIT_TIMEOUT_MINUTES, MINUTES);
}
use of com.hazelcast.core.Member in project hazelcast by hazelcast.
the class NodeQueryCacheEndToEndConstructor method madePublishable.
private void madePublishable(String mapName, String cacheName) throws Exception {
InvokerWrapper invokerWrapper = context.getInvokerWrapper();
Collection<Member> memberList = context.getMemberList();
List<Future> futures = new ArrayList<Future>(memberList.size());
for (Member member : memberList) {
Operation operation = new MadePublishableOperation(mapName, cacheName);
Future future = invokerWrapper.invokeOnTarget(operation, member.getAddress());
futures.add(future);
}
waitWithDeadline(futures, OPERATION_WAIT_TIMEOUT_MINUTES, MINUTES);
}
Aggregations