use of com.hazelcast.internal.cluster.ClusterService in project hazelcast by hazelcast.
the class MapPublisherCreateMessageTask method call.
@Override
protected Object call() throws Exception {
ClusterService clusterService = clientEngine.getClusterService();
Collection<MemberImpl> members = clusterService.getMemberImpls();
List<Future> futures = new ArrayList<Future>(members.size());
createInvocations(members, futures);
return getQueryResults(futures);
}
use of com.hazelcast.internal.cluster.ClusterService in project hazelcast by hazelcast.
the class MapPublisherCreateWithValueMessageTask method call.
@Override
protected Object call() throws Exception {
ClusterService clusterService = clientEngine.getClusterService();
Collection<MemberImpl> members = clusterService.getMemberImpls();
List<Future> futures = new ArrayList<Future>(members.size());
createInvocations(members, futures);
return getQueryResults(futures);
}
use of com.hazelcast.internal.cluster.ClusterService in project hazelcast by hazelcast.
the class AddDistributedObjectListenerMessageTask method shouldSendEvent.
private boolean shouldSendEvent() {
if (!endpoint.isAlive()) {
return false;
}
ClusterService clusterService = clientEngine.getClusterService();
boolean currentMemberIsMaster = clusterService.getMasterAddress().equals(clientEngine.getThisAddress());
if (parameters.localOnly && !currentMemberIsMaster) {
//if client registered localOnly, only master is allowed to send request
return false;
}
return true;
}
use of com.hazelcast.internal.cluster.ClusterService in project hazelcast by hazelcast.
the class AbstractMapReduceTask method startSupervisionTask.
private void startSupervisionTask(JobTracker jobTracker) {
final MapReduceService mapReduceService = getService(MapReduceService.SERVICE_NAME);
final JobTrackerConfig config = ((AbstractJobTracker) jobTracker).getJobTrackerConfig();
final boolean communicateStats = config.isCommunicateStats();
final int chunkSize = getChunkSizeOrConfigChunkSize(config);
final TopologyChangedStrategy topologyChangedStrategy = getTopologyChangedStrategyOrConfigTopologyChangedStrategy(config);
final String name = getDistributedObjectName();
final String jobId = getJobId();
final KeyValueSource keyValueSource = getKeyValueSource();
final Mapper mapper = getMapper();
final CombinerFactory combinerFactory = getCombinerFactory();
final ReducerFactory reducerFactory = getReducerFactory();
final Collection keys = getKeys();
final Collection<Object> keyObjects = getKeyObjects(keys);
final KeyPredicate predicate = getPredicate();
final ClusterService clusterService = nodeEngine.getClusterService();
for (Member member : clusterService.getMembers(KeyValueJobOperation.MEMBER_SELECTOR)) {
Operation operation = new KeyValueJobOperation(name, jobId, chunkSize, keyValueSource, mapper, combinerFactory, reducerFactory, communicateStats, topologyChangedStrategy);
executeOperation(operation, member.getAddress(), mapReduceService, nodeEngine);
}
// After we prepared all the remote systems we can now start the processing
for (Member member : clusterService.getMembers(DATA_MEMBER_SELECTOR)) {
Operation operation = new StartProcessingJobOperation(name, jobId, keyObjects, predicate);
executeOperation(operation, member.getAddress(), mapReduceService, nodeEngine);
}
}
use of com.hazelcast.internal.cluster.ClusterService in project hazelcast by hazelcast.
the class HttpGetCommandProcessor method handleGetClusterVersion.
private void handleGetClusterVersion(HttpGetCommand command) {
String res = "{\"status\":\"${STATUS}\",\"version\":\"${VERSION}\"}";
Node node = textCommandService.getNode();
ClusterService clusterService = node.getClusterService();
res = res.replace("${STATUS}", "success");
res = res.replace("${VERSION}", clusterService.getClusterVersion().toString());
command.setResponse(HttpCommand.CONTENT_TYPE_JSON, stringToBytes(res));
}
Aggregations