Search in sources :

Example 1 with NotifyMemberShutdownOperation

use of com.hazelcast.jet.impl.operation.NotifyMemberShutdownOperation in project hazelcast by hazelcast.

the class JetServiceBackend method notifyMasterWeAreShuttingDown.

private void notifyMasterWeAreShuttingDown(CompletableFuture<Void> future) {
    Operation op = new NotifyMemberShutdownOperation();
    nodeEngine.getOperationService().invokeOnTarget(JetServiceBackend.SERVICE_NAME, op, nodeEngine.getClusterService().getMasterAddress()).whenCompleteAsync((response, throwable) -> {
        if (throwable != null) {
            logger.warning("Failed to notify master member that this member is shutting down," + " will retry in " + NOTIFY_MEMBER_SHUTDOWN_DELAY + " seconds", throwable);
            // recursive call
            nodeEngine.getExecutionService().schedule(() -> notifyMasterWeAreShuttingDown(future), NOTIFY_MEMBER_SHUTDOWN_DELAY, SECONDS);
        } else {
            future.complete(null);
        }
    });
}
Also used : PrepareForPassiveClusterOperation(com.hazelcast.jet.impl.operation.PrepareForPassiveClusterOperation) NotifyMemberShutdownOperation(com.hazelcast.jet.impl.operation.NotifyMemberShutdownOperation) Operation(com.hazelcast.spi.impl.operationservice.Operation) NotifyMemberShutdownOperation(com.hazelcast.jet.impl.operation.NotifyMemberShutdownOperation)

Aggregations

NotifyMemberShutdownOperation (com.hazelcast.jet.impl.operation.NotifyMemberShutdownOperation)1 PrepareForPassiveClusterOperation (com.hazelcast.jet.impl.operation.PrepareForPassiveClusterOperation)1 Operation (com.hazelcast.spi.impl.operationservice.Operation)1