use of org.apache.ignite.raft.jraft.FSMCaller in project ignite-3 by apache.
the class FSMCallerImpl method shutdown.
@Override
public synchronized void shutdown() {
if (this.shutdownLatch != null) {
return;
}
LOG.info("Shutting down FSMCaller...");
if (this.taskQueue != null) {
final CountDownLatch latch = new CountDownLatch(1);
this.shutdownLatch = latch;
Utils.runInThread(this.node.getOptions().getCommonExecutor(), () -> this.taskQueue.publishEvent((task, sequence) -> {
task.reset();
task.groupId = groupId;
task.type = TaskType.SHUTDOWN;
task.shutdownLatch = latch;
}));
}
doShutdown();
}
Aggregations