use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class ExecutorServiceProxy method submitToMembers.
@Override
public <T> void submitToMembers(@Nonnull Callable<T> task, @Nonnull Collection<Member> members, @Nonnull MultiExecutionCallback callback) {
checkNotNull(task, "task must not be null");
checkNotNull(members, "members must not be null");
NodeEngine nodeEngine = getNodeEngine();
ILogger logger = nodeEngine.getLogger(ExecutionCallbackAdapterFactory.class);
ExecutionCallbackAdapterFactory executionCallbackFactory = new ExecutionCallbackAdapterFactory(logger, members, callback);
Data taskData = nodeEngine.toData(task);
for (Member member : members) {
submitToMember(taskData, member, executionCallbackFactory.<T>callbackFor(member));
}
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class LockStoreContainer method createScheduler.
private EntryTaskScheduler<Data, Integer> createScheduler(ObjectNamespace namespace) {
NodeEngine nodeEngine = lockService.getNodeEngine();
LockEvictionProcessor entryProcessor = new LockEvictionProcessor(nodeEngine, namespace);
TaskScheduler globalScheduler = nodeEngine.getExecutionService().getGlobalTaskScheduler();
return EntryTaskSchedulerFactory.newScheduler(globalScheduler, entryProcessor, ScheduleType.FOR_EACH);
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class LocalLockCleanupOperation method shouldBackup.
@Override
public boolean shouldBackup() {
final NodeEngine nodeEngine = getNodeEngine();
IPartitionService partitionService = nodeEngine.getPartitionService();
IPartition partition = partitionService.getPartition(getPartitionId());
return partition.isLocal() && Boolean.TRUE.equals(response);
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class BaseMigrationOperation method verifyClusterState.
/**
* Verifies that the cluster is active.
*/
private void verifyClusterState() {
NodeEngine nodeEngine = getNodeEngine();
ClusterState clusterState = nodeEngine.getClusterService().getClusterState();
if (!clusterState.isMigrationAllowed()) {
throw new IllegalStateException("Cluster state does not allow migrations! " + clusterState);
}
}
use of com.hazelcast.spi.impl.NodeEngine in project hazelcast by hazelcast.
the class MigrationCommitOperation method run.
@Override
public void run() {
NodeEngine nodeEngine = getNodeEngine();
final Member localMember = nodeEngine.getLocalMember();
if (!localMember.getUuid().equals(expectedMemberUuid)) {
throw new IllegalStateException("This " + localMember + " is migration commit destination but most probably it's restarted " + "and not the expected target.");
}
InternalPartitionServiceImpl service = getService();
success = service.commitMigrationOnDestination(migration, getCallerAddress());
}
Aggregations