Search in sources :

Example 36 with ExecutionService

use of com.hazelcast.spi.impl.executionservice.ExecutionService in project hazelcast by hazelcast.

the class MetadataRaftGroupManager method scheduleGroupMembershipManagementTasks.

private void scheduleGroupMembershipManagementTasks() {
    ExecutionService executionService = nodeEngine.getExecutionService();
    executionService.scheduleWithRepetition(CP_SUBSYSTEM_MANAGEMENT_EXECUTOR, new BroadcastActiveCPMembersTask(), 0, BROADCAST_ACTIVE_CP_MEMBERS_TASK_PERIOD_SECONDS, SECONDS);
    membershipManager.init();
}
Also used : ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService)

Example 37 with ExecutionService

use of com.hazelcast.spi.impl.executionservice.ExecutionService in project hazelcast by hazelcast.

the class RaftInvocationManager method triggerRaftNodeCreation.

void triggerRaftNodeCreation(CPGroupSummary group) {
    for (CPMember groupMember : group.members()) {
        if (groupMember.equals(raftService.getLocalCPMember())) {
            ExecutionService executionService = nodeEngine.getExecutionService();
            executionService.execute(CP_SUBSYSTEM_EXECUTOR, () -> raftService.createRaftNode(group.id(), group.initialMembers()));
        } else {
            Operation op = new CreateRaftNodeOp(group.id(), group.initialMembers());
            OperationService operationService = nodeEngine.getOperationService();
            operationService.send(op, groupMember.getAddress());
        }
    }
}
Also used : CreateRaftNodeOp(com.hazelcast.cp.internal.raftop.metadata.CreateRaftNodeOp) Operation(com.hazelcast.spi.impl.operationservice.Operation) OperationService(com.hazelcast.spi.impl.operationservice.OperationService) ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService) CPMember(com.hazelcast.cp.CPMember)

Example 38 with ExecutionService

use of com.hazelcast.spi.impl.executionservice.ExecutionService in project hazelcast by hazelcast.

the class AbstractBlockingService method scheduleTimeout.

protected final void scheduleTimeout(CPGroupId groupId, String name, UUID invocationUid, long timeoutMs) {
    if (timeoutMs > 0 && timeoutMs <= WAIT_TIMEOUT_TASK_UPPER_BOUND_MILLIS) {
        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.schedule(new ExpireWaitKeysTask(groupId, BiTuple.of(name, invocationUid)), timeoutMs, MILLISECONDS);
    }
}
Also used : ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService)

Example 39 with ExecutionService

use of com.hazelcast.spi.impl.executionservice.ExecutionService in project hazelcast by hazelcast.

the class RaftSessionService method init.

@Override
public void init(NodeEngine nodeEngine, Properties properties) {
    this.raftService = nodeEngine.getService(RaftService.SERVICE_NAME);
    for (SessionAwareService service : nodeEngine.getServices(SessionAwareService.class)) {
        service.setSessionAccessor(this);
    }
    ExecutionService executionService = nodeEngine.getExecutionService();
    executionService.scheduleWithRepetition(new CheckSessionsToExpire(), CHECK_EXPIRED_SESSIONS_TASK_PERIOD_IN_MILLIS, CHECK_EXPIRED_SESSIONS_TASK_PERIOD_IN_MILLIS, MILLISECONDS);
    executionService.scheduleWithRepetition(new CheckInactiveSessions(), CHECK_INACTIVE_SESSIONS_TASK_PERIOD_IN_MILLIS, CHECK_INACTIVE_SESSIONS_TASK_PERIOD_IN_MILLIS, MILLISECONDS);
    this.nodeEngine.getMetricsRegistry().registerDynamicMetricsProvider(this);
}
Also used : ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService)

Example 40 with ExecutionService

use of com.hazelcast.spi.impl.executionservice.ExecutionService in project hazelcast by hazelcast.

the class ClusterHeartbeatManager method init.

/**
 * Initializes the {@link ClusterHeartbeatManager}. It will schedule the
 * heartbeat operation to the {@link #getHeartbeatInterval(HazelcastProperties)} interval.
 */
void init() {
    ExecutionService executionService = nodeEngine.getExecutionService();
    executionService.scheduleWithRepetition(CLUSTER_EXECUTOR_NAME, this::heartbeat, heartbeatIntervalMillis, heartbeatIntervalMillis, TimeUnit.MILLISECONDS);
    if (icmpParallelMode) {
        startPeriodicPinger();
    }
}
Also used : ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService)

Aggregations

ExecutionService (com.hazelcast.spi.impl.executionservice.ExecutionService)46 ILogger (com.hazelcast.logging.ILogger)10 ManagementCenterService (com.hazelcast.internal.management.ManagementCenterService)7 CALLER_RUNS (com.hazelcast.internal.util.ConcurrencyUtil.CALLER_RUNS)7 ExceptionUtil.peel (com.hazelcast.internal.util.ExceptionUtil.peel)7 ExceptionUtil.withTryCatch (com.hazelcast.internal.util.ExceptionUtil.withTryCatch)7 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)7 Future (java.util.concurrent.Future)7 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)6 QuickTest (com.hazelcast.test.annotation.QuickTest)6 Test (org.junit.Test)6 CountDownLatch (java.util.concurrent.CountDownLatch)5 IExecutorService (com.hazelcast.core.IExecutorService)4 AbstractLocalOperation (com.hazelcast.spi.impl.operationservice.AbstractLocalOperation)4 HazelcastInstance (com.hazelcast.core.HazelcastInstance)3 Node (com.hazelcast.instance.impl.Node)3 NodeEngine (com.hazelcast.spi.impl.NodeEngine)3 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)3 ExecutorService (java.util.concurrent.ExecutorService)3 ClientMessage (com.hazelcast.client.impl.protocol.ClientMessage)2