use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class QueueProxySupport method invoke.
private InternalCompletableFuture invoke(Operation operation) {
final NodeEngine nodeEngine = getNodeEngine();
OperationService operationService = nodeEngine.getOperationService();
return operationService.invokeOnPartition(QueueService.SERVICE_NAME, operation, getPartitionId());
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class QueueReplicationOperation method run.
@Override
public void run() {
QueueService service = getService();
NodeEngine nodeEngine = getNodeEngine();
Config config = nodeEngine.getConfig();
for (Map.Entry<String, QueueContainer> entry : migrationData.entrySet()) {
String name = entry.getKey();
QueueContainer container = entry.getValue();
QueueConfig conf = config.findQueueConfig(name);
container.setConfig(conf, nodeEngine, service);
service.addContainer(name, container);
}
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class CacheCreateConfigOperation method run.
@Override
public void run() throws Exception {
ICacheService service = getService();
if (!ignoreLocal) {
response = service.putCacheConfigIfAbsent(config);
}
if (createAlsoOnOthers) {
NodeEngine nodeEngine = getNodeEngine();
Collection<Member> members = nodeEngine.getClusterService().getMembers();
int remoteNodeCount = members.size() - 1;
if (remoteNodeCount > 0) {
postponeReturnResponse();
ExecutionCallback<Object> callback = new CacheConfigCreateCallback(this, remoteNodeCount);
OperationService operationService = nodeEngine.getOperationService();
for (Member member : members) {
if (!member.localMember()) {
CacheCreateConfigOperation op = new CacheCreateConfigOperation(config, false);
operationService.createInvocationBuilder(ICacheService.SERVICE_NAME, op, member.getAddress()).setExecutionCallback(callback).invoke();
}
}
}
}
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class CacheDestroyOperation method destroyCacheOnAllMembers.
private void destroyCacheOnAllMembers(String name, String callerUuid) {
NodeEngine nodeEngine = getNodeEngine();
OperationService operationService = nodeEngine.getOperationService();
Collection<Member> members = nodeEngine.getClusterService().getMembers();
for (Member member : members) {
if (!member.localMember() && !member.getUuid().equals(callerUuid)) {
CacheDestroyOperation op = new CacheDestroyOperation(name, true);
operationService.invokeOnTarget(ICacheService.SERVICE_NAME, op, member.getAddress());
}
}
}
use of com.hazelcast.spi.NodeEngine in project hazelcast by hazelcast.
the class AbstractMapReduceTask method processMessage.
@Override
protected void processMessage() {
MapReduceService mapReduceService = getService(MapReduceService.SERVICE_NAME);
NodeEngine nodeEngine = mapReduceService.getNodeEngine();
ClusterService clusterService = nodeEngine.getClusterService();
if (clusterService.getSize(MemberSelectors.DATA_MEMBER_SELECTOR) == 0) {
throw new IllegalStateException("Could not register map reduce job since there are no nodes owning a partition");
}
final String objectName = getDistributedObjectName();
AbstractJobTracker jobTracker = (AbstractJobTracker) mapReduceService.createDistributedObject(objectName);
TrackableJobFuture jobFuture = new TrackableJobFuture(objectName, getJobId(), jobTracker, nodeEngine, null);
if (jobTracker.registerTrackableJob(jobFuture)) {
startSupervisionTask(jobTracker);
jobFuture.andThen(this);
}
}
Aggregations