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);
}
});
}
Aggregations