Search in sources :

Example 1 with FSMCaller

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();
}
Also used : Configuration(org.apache.ignite.raft.jraft.conf.Configuration) StateMachine(org.apache.ignite.raft.jraft.StateMachine) RaftException(org.apache.ignite.raft.jraft.error.RaftException) EnumOutter(org.apache.ignite.raft.jraft.entity.EnumOutter) Requires(org.apache.ignite.raft.jraft.util.Requires) TaskClosure(org.apache.ignite.raft.jraft.closure.TaskClosure) LogEntry(org.apache.ignite.raft.jraft.entity.LogEntry) SaveSnapshotClosure(org.apache.ignite.raft.jraft.closure.SaveSnapshotClosure) IgniteLogger(org.apache.ignite.lang.IgniteLogger) RaftMessagesFactory(org.apache.ignite.raft.jraft.RaftMessagesFactory) ArrayList(java.util.ArrayList) StripedDisruptor(org.apache.ignite.raft.jraft.disruptor.StripedDisruptor) LogId(org.apache.ignite.raft.jraft.entity.LogId) EventHandler(com.lmax.disruptor.EventHandler) ErrorType(org.apache.ignite.raft.jraft.entity.EnumOutter.ErrorType) Closure(org.apache.ignite.raft.jraft.Closure) RingBuffer(com.lmax.disruptor.RingBuffer) FSMCallerOptions(org.apache.ignite.raft.jraft.option.FSMCallerOptions) SnapshotReader(org.apache.ignite.raft.jraft.storage.snapshot.SnapshotReader) Status(org.apache.ignite.raft.jraft.Status) ClosureQueue(org.apache.ignite.raft.jraft.closure.ClosureQueue) GroupAware(org.apache.ignite.raft.jraft.disruptor.GroupAware) OnlyForTest(org.apache.ignite.raft.jraft.util.OnlyForTest) Utils(org.apache.ignite.raft.jraft.util.Utils) CountDownLatch(java.util.concurrent.CountDownLatch) AtomicLong(java.util.concurrent.atomic.AtomicLong) ConfigurationEntry(org.apache.ignite.raft.jraft.conf.ConfigurationEntry) PeerId(org.apache.ignite.raft.jraft.entity.PeerId) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) LoadSnapshotClosure(org.apache.ignite.raft.jraft.closure.LoadSnapshotClosure) EventTranslator(com.lmax.disruptor.EventTranslator) FSMCaller(org.apache.ignite.raft.jraft.FSMCaller) SnapshotMetaBuilder(org.apache.ignite.raft.jraft.entity.SnapshotMetaBuilder) LeaderChangeContext(org.apache.ignite.raft.jraft.entity.LeaderChangeContext) DisruptorMetricSet(org.apache.ignite.raft.jraft.util.DisruptorMetricSet) SnapshotWriter(org.apache.ignite.raft.jraft.storage.snapshot.SnapshotWriter) RaftOutter(org.apache.ignite.raft.jraft.entity.RaftOutter) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) RaftError(org.apache.ignite.raft.jraft.error.RaftError) LogManager(org.apache.ignite.raft.jraft.storage.LogManager) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

EventHandler (com.lmax.disruptor.EventHandler)1 EventTranslator (com.lmax.disruptor.EventTranslator)1 RingBuffer (com.lmax.disruptor.RingBuffer)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 Collectors.toList (java.util.stream.Collectors.toList)1 IgniteLogger (org.apache.ignite.lang.IgniteLogger)1 Closure (org.apache.ignite.raft.jraft.Closure)1 FSMCaller (org.apache.ignite.raft.jraft.FSMCaller)1 RaftMessagesFactory (org.apache.ignite.raft.jraft.RaftMessagesFactory)1 StateMachine (org.apache.ignite.raft.jraft.StateMachine)1 Status (org.apache.ignite.raft.jraft.Status)1 ClosureQueue (org.apache.ignite.raft.jraft.closure.ClosureQueue)1 LoadSnapshotClosure (org.apache.ignite.raft.jraft.closure.LoadSnapshotClosure)1 SaveSnapshotClosure (org.apache.ignite.raft.jraft.closure.SaveSnapshotClosure)1 TaskClosure (org.apache.ignite.raft.jraft.closure.TaskClosure)1 Configuration (org.apache.ignite.raft.jraft.conf.Configuration)1