Search in sources :

Example 1 with Task

use of org.apache.ignite.raft.jraft.entity.Task in project ignite-3 by apache.

the class ItNodeTest method testNodeTaskOverload.

@Test
public void testNodeTaskOverload() throws Exception {
    Endpoint addr = new Endpoint(TestUtils.getLocalAddress(), TestUtils.INIT_PORT);
    PeerId peer = new PeerId(addr, 0);
    NodeOptions nodeOptions = createNodeOptions();
    RaftOptions raftOptions = new RaftOptions();
    raftOptions.setDisruptorBufferSize(2);
    nodeOptions.setRaftOptions(raftOptions);
    MockStateMachine fsm = new MockStateMachine(addr);
    nodeOptions.setFsm(fsm);
    nodeOptions.setLogUri(dataPath + File.separator + "log");
    nodeOptions.setRaftMetaUri(dataPath + File.separator + "meta");
    nodeOptions.setSnapshotUri(dataPath + File.separator + "snapshot");
    nodeOptions.setInitialConf(new Configuration(Collections.singletonList(peer)));
    RaftGroupService service = createService("unittest", new PeerId(addr, 0), nodeOptions);
    Node node = service.start();
    assertEquals(1, node.listPeers().size());
    assertTrue(node.listPeers().contains(peer));
    while (!node.isLeader()) ;
    List<Task> tasks = new ArrayList<>();
    AtomicInteger c = new AtomicInteger(0);
    for (int i = 0; i < 10; i++) {
        ByteBuffer data = ByteBuffer.wrap(("hello" + i).getBytes(UTF_8));
        int finalI = i;
        Task task = new Task(data, new JoinableClosure(status -> {
            LOG.info("{} i={}", status, finalI);
            if (!status.isOk()) {
                assertTrue(status.getRaftError() == RaftError.EBUSY || status.getRaftError() == RaftError.EPERM);
            }
            c.incrementAndGet();
        }));
        node.apply(task);
        tasks.add(task);
    }
    Task.joinAll(tasks, TimeUnit.SECONDS.toMillis(30));
    assertEquals(10, c.get());
}
Also used : SynchronizedClosure(org.apache.ignite.raft.jraft.closure.SynchronizedClosure) BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) ExponentialBackoffTimeoutStrategy(org.apache.ignite.raft.jraft.util.ExponentialBackoffTimeoutStrategy) TaskClosure(org.apache.ignite.raft.jraft.closure.TaskClosure) SnapshotThrottle(org.apache.ignite.raft.jraft.storage.SnapshotThrottle) Disabled(org.junit.jupiter.api.Disabled) BooleanSupplier(java.util.function.BooleanSupplier) AfterAll(org.junit.jupiter.api.AfterAll) Future(java.util.concurrent.Future) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) BeforeAll(org.junit.jupiter.api.BeforeAll) Path(java.nio.file.Path) Collections.synchronizedList(java.util.Collections.synchronizedList) Set(java.util.Set) Assertions.assertNotSame(org.junit.jupiter.api.Assertions.assertNotSame) ELECTION_TIMEOUT_MILLIS(org.apache.ignite.raft.jraft.core.TestCluster.ELECTION_TIMEOUT_MILLIS) TestUtils(org.apache.ignite.raft.jraft.test.TestUtils) ExecutorServiceHelper(org.apache.ignite.raft.jraft.util.ExecutorServiceHelper) Executors(java.util.concurrent.Executors) CountDownLatch(java.util.concurrent.CountDownLatch) Stream(java.util.stream.Stream) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Endpoint(org.apache.ignite.raft.jraft.util.Endpoint) RaftError(org.apache.ignite.raft.jraft.error.RaftError) RpcServer(org.apache.ignite.raft.jraft.rpc.RpcServer) Assertions.fail(org.junit.jupiter.api.Assertions.fail) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) StateMachine(org.apache.ignite.raft.jraft.StateMachine) RaftException(org.apache.ignite.raft.jraft.error.RaftException) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) ArrayList(java.util.ArrayList) Task(org.apache.ignite.raft.jraft.entity.Task) IgniteRpcServer(org.apache.ignite.raft.jraft.rpc.impl.IgniteRpcServer) TestScaleCubeClusterServiceFactory(org.apache.ignite.network.scalecube.TestScaleCubeClusterServiceFactory) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) LinkedHashSet(java.util.LinkedHashSet) NodeManager(org.apache.ignite.raft.jraft.NodeManager) LogIndexOutOfBoundsException(org.apache.ignite.raft.jraft.error.LogIndexOutOfBoundsException) RaftGroupService(org.apache.ignite.raft.jraft.RaftGroupService) LogNotFoundException(org.apache.ignite.raft.jraft.error.LogNotFoundException) DefaultRaftClientService(org.apache.ignite.raft.jraft.rpc.impl.core.DefaultRaftClientService) File(java.io.File) Assertions.assertSame(org.junit.jupiter.api.Assertions.assertSame) WorkDirectory(org.apache.ignite.internal.testframework.WorkDirectory) NetworkAddress(org.apache.ignite.network.NetworkAddress) Assertions.assertArrayEquals(org.junit.jupiter.api.Assertions.assertArrayEquals) AfterEach(org.junit.jupiter.api.AfterEach) ConsoleReporter(com.codahale.metrics.ConsoleReporter) RaftOptions(org.apache.ignite.raft.jraft.option.RaftOptions) EnumOutter(org.apache.ignite.raft.jraft.entity.EnumOutter) Assertions.assertNotEquals(org.junit.jupiter.api.Assertions.assertNotEquals) TestUtils.sender(org.apache.ignite.raft.jraft.test.TestUtils.sender) IgniteLogger(org.apache.ignite.lang.IgniteLogger) ByteBuffer(java.nio.ByteBuffer) ReadOnlyOption(org.apache.ignite.raft.jraft.option.ReadOnlyOption) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) NodeFinder(org.apache.ignite.network.NodeFinder) Node(org.apache.ignite.raft.jraft.Node) JoinableClosure(org.apache.ignite.raft.jraft.closure.JoinableClosure) TestIgniteRpcServer(org.apache.ignite.raft.jraft.rpc.TestIgniteRpcServer) SnapshotReader(org.apache.ignite.raft.jraft.storage.snapshot.SnapshotReader) Status(org.apache.ignite.raft.jraft.Status) BootstrapOptions(org.apache.ignite.raft.jraft.option.BootstrapOptions) TestInfo(org.junit.jupiter.api.TestInfo) Utils(org.apache.ignite.raft.jraft.util.Utils) Test(org.junit.jupiter.api.Test) List(java.util.List) StaticNodeFinder(org.apache.ignite.network.StaticNodeFinder) RpcClientEx(org.apache.ignite.raft.jraft.rpc.RpcClientEx) Configuration(org.apache.ignite.raft.jraft.conf.Configuration) ReadIndexClosure(org.apache.ignite.raft.jraft.closure.ReadIndexClosure) Bits(org.apache.ignite.raft.jraft.util.Bits) ClusterServiceTestUtils(org.apache.ignite.utils.ClusterServiceTestUtils) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CompletableFuture(java.util.concurrent.CompletableFuture) FixedThreadsExecutorGroup(org.apache.ignite.raft.jraft.util.concurrent.FixedThreadsExecutorGroup) AtomicReference(java.util.concurrent.atomic.AtomicReference) NodeOptions(org.apache.ignite.raft.jraft.option.NodeOptions) HashSet(java.util.HashSet) BiPredicate(java.util.function.BiPredicate) Iterator(org.apache.ignite.raft.jraft.Iterator) ExecutorService(java.util.concurrent.ExecutorService) JRaftUtils(org.apache.ignite.raft.jraft.JRaftUtils) UTF_8(java.nio.charset.StandardCharsets.UTF_8) RpcRequests(org.apache.ignite.raft.jraft.rpc.RpcRequests) IgniteRpcClient(org.apache.ignite.raft.jraft.rpc.impl.IgniteRpcClient) TimeUnit(java.util.concurrent.TimeUnit) PeerId(org.apache.ignite.raft.jraft.entity.PeerId) Collectors.toList(java.util.stream.Collectors.toList) ThroughputSnapshotThrottle(org.apache.ignite.raft.jraft.storage.snapshot.ThroughputSnapshotThrottle) ClusterService(org.apache.ignite.network.ClusterService) WorkDirectoryExtension(org.apache.ignite.internal.testframework.WorkDirectoryExtension) UserLog(org.apache.ignite.raft.jraft.entity.UserLog) Collections(java.util.Collections) RaftOptions(org.apache.ignite.raft.jraft.option.RaftOptions) Task(org.apache.ignite.raft.jraft.entity.Task) Configuration(org.apache.ignite.raft.jraft.conf.Configuration) RaftGroupService(org.apache.ignite.raft.jraft.RaftGroupService) Node(org.apache.ignite.raft.jraft.Node) ArrayList(java.util.ArrayList) NodeOptions(org.apache.ignite.raft.jraft.option.NodeOptions) ByteBuffer(java.nio.ByteBuffer) Endpoint(org.apache.ignite.raft.jraft.util.Endpoint) Endpoint(org.apache.ignite.raft.jraft.util.Endpoint) JoinableClosure(org.apache.ignite.raft.jraft.closure.JoinableClosure) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) PeerId(org.apache.ignite.raft.jraft.entity.PeerId) Test(org.junit.jupiter.api.Test)

Example 2 with Task

use of org.apache.ignite.raft.jraft.entity.Task in project ignite-3 by apache.

the class ItNodeTest method testChangePeersChaosWithSnapshot.

@Test
public void testChangePeersChaosWithSnapshot() throws Exception {
    // start cluster
    List<PeerId> peers = new ArrayList<>();
    peers.add(new PeerId(TestUtils.getLocalAddress(), TestUtils.INIT_PORT));
    cluster = new TestCluster("unittest", dataPath, peers, ELECTION_TIMEOUT_MILLIS, testInfo);
    assertTrue(cluster.start(peers.get(0).getEndpoint(), false, 2));
    // start other peers
    for (int i = 1; i < 10; i++) {
        PeerId peer = new PeerId(TestUtils.getLocalAddress(), TestUtils.INIT_PORT + i);
        peers.add(peer);
        assertTrue(cluster.start(peer.getEndpoint()));
    }
    ChangeArg arg = new ChangeArg(cluster, peers, false, false);
    Future<?> future = startChangePeersThread(arg);
    for (int i = 0; i < 5000; ) {
        cluster.waitLeader();
        Node leader = cluster.getLeader();
        if (leader == null)
            continue;
        SynchronizedClosure done = new SynchronizedClosure();
        Task task = new Task(ByteBuffer.wrap(("hello" + i).getBytes(UTF_8)), done);
        leader.apply(task);
        Status status = done.await();
        if (status.isOk()) {
            if (++i % 100 == 0)
                System.out.println("Progress:" + i);
        } else
            assertEquals(RaftError.EPERM, status.getRaftError());
    }
    arg.stop = true;
    future.get();
    cluster.waitLeader();
    SynchronizedClosure done = new SynchronizedClosure();
    Node leader = cluster.getLeader();
    leader.changePeers(new Configuration(peers), done);
    Status st = done.await();
    assertTrue(st.isOk(), st.getErrorMsg());
    cluster.ensureSame();
    assertEquals(10, cluster.getFsms().size());
    for (MockStateMachine fsm : cluster.getFsms()) assertTrue(fsm.getLogs().size() >= 5000);
}
Also used : Status(org.apache.ignite.raft.jraft.Status) SynchronizedClosure(org.apache.ignite.raft.jraft.closure.SynchronizedClosure) Task(org.apache.ignite.raft.jraft.entity.Task) Configuration(org.apache.ignite.raft.jraft.conf.Configuration) Node(org.apache.ignite.raft.jraft.Node) ArrayList(java.util.ArrayList) Endpoint(org.apache.ignite.raft.jraft.util.Endpoint) PeerId(org.apache.ignite.raft.jraft.entity.PeerId) Test(org.junit.jupiter.api.Test)

Example 3 with Task

use of org.apache.ignite.raft.jraft.entity.Task in project ignite-3 by apache.

the class ItNodeTest method sendTestTaskAndWait.

@SuppressWarnings("SameParameterValue")
private void sendTestTaskAndWait(String prefix, Node node, int amount, int code) throws InterruptedException {
    CountDownLatch latch = new CountDownLatch(10);
    for (int i = 0; i < amount; i++) {
        ByteBuffer data = ByteBuffer.wrap((prefix + i).getBytes(UTF_8));
        Task task = new Task(data, new ExpectClosure(code, null, latch));
        node.apply(task);
    }
    waitLatch(latch);
}
Also used : Task(org.apache.ignite.raft.jraft.entity.Task) CountDownLatch(java.util.concurrent.CountDownLatch) ByteBuffer(java.nio.ByteBuffer) Endpoint(org.apache.ignite.raft.jraft.util.Endpoint)

Example 4 with Task

use of org.apache.ignite.raft.jraft.entity.Task in project ignite-3 by apache.

the class ItNodeTest method sendTestTaskAndWait.

// Note that waiting for the latch when tasks are applying doesn't guarantee that FSMCallerImpl.lastAppliedIndex
// will be updated immediately.
private void sendTestTaskAndWait(Node node, int start, int amount, RaftError err) throws InterruptedException {
    CountDownLatch latch = new CountDownLatch(amount);
    for (int i = start; i < start + amount; i++) {
        ByteBuffer data = ByteBuffer.wrap(("hello" + i).getBytes(UTF_8));
        Task task = new Task(data, new ExpectClosure(err, latch));
        node.apply(task);
    }
    waitLatch(latch);
}
Also used : Task(org.apache.ignite.raft.jraft.entity.Task) CountDownLatch(java.util.concurrent.CountDownLatch) ByteBuffer(java.nio.ByteBuffer) Endpoint(org.apache.ignite.raft.jraft.util.Endpoint)

Example 5 with Task

use of org.apache.ignite.raft.jraft.entity.Task in project ignite-3 by apache.

the class NodeImpl method executeApplyingTasks.

private void executeApplyingTasks(final List<LogEntryAndClosure> tasks) {
    this.writeLock.lock();
    try {
        final int size = tasks.size();
        if (this.state != State.STATE_LEADER) {
            final Status st = new Status();
            if (this.state != State.STATE_TRANSFERRING) {
                st.setError(RaftError.EPERM, "Is not leader.");
            } else {
                st.setError(RaftError.EBUSY, "Is transferring leadership.");
            }
            LOG.debug("Node {} can't apply, status={}.", getNodeId(), st);
            final List<Closure> dones = tasks.stream().map(ele -> ele.done).collect(Collectors.toList());
            Utils.runInThread(this.getOptions().getCommonExecutor(), () -> {
                for (final Closure done : dones) {
                    done.run(st);
                }
            });
            return;
        }
        final List<LogEntry> entries = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            final LogEntryAndClosure task = tasks.get(i);
            if (task.expectedTerm != -1 && task.expectedTerm != this.currTerm) {
                LOG.debug("Node {} can't apply task whose expectedTerm={} doesn't match currTerm={}.", getNodeId(), task.expectedTerm, this.currTerm);
                if (task.done != null) {
                    final Status st = new Status(RaftError.EPERM, "expected_term=%d doesn't match current_term=%d", task.expectedTerm, this.currTerm);
                    Utils.runClosureInThread(this.getOptions().getCommonExecutor(), task.done, st);
                }
                continue;
            }
            if (!this.ballotBox.appendPendingTask(this.conf.getConf(), this.conf.isStable() ? null : this.conf.getOldConf(), task.done)) {
                Utils.runClosureInThread(this.getOptions().getCommonExecutor(), task.done, new Status(RaftError.EINTERNAL, "Fail to append task."));
                continue;
            }
            // set task entry info before adding to list.
            task.entry.getId().setTerm(this.currTerm);
            task.entry.setType(EnumOutter.EntryType.ENTRY_TYPE_DATA);
            entries.add(task.entry);
        }
        this.logManager.appendEntries(entries, new LeaderStableClosure(entries));
        // update conf.first
        checkAndSetConfiguration(true);
    } finally {
        this.writeLock.unlock();
    }
}
Also used : Status(org.apache.ignite.raft.jraft.Status) SynchronizedClosure(org.apache.ignite.raft.jraft.closure.SynchronizedClosure) SnapshotExecutorImpl(org.apache.ignite.raft.jraft.storage.snapshot.SnapshotExecutorImpl) ReadWriteLock(java.util.concurrent.locks.ReadWriteLock) Set(java.util.Set) AppendEntriesResponse(org.apache.ignite.raft.jraft.rpc.RpcRequests.AppendEntriesResponse) ExecutorServiceHelper(org.apache.ignite.raft.jraft.util.ExecutorServiceHelper) AppendEntriesRequest(org.apache.ignite.raft.jraft.rpc.RpcRequests.AppendEntriesRequest) CountDownLatch(java.util.concurrent.CountDownLatch) ConfigurationEntry(org.apache.ignite.raft.jraft.conf.ConfigurationEntry) SnapshotExecutorOptions(org.apache.ignite.raft.jraft.option.SnapshotExecutorOptions) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) RaftError(org.apache.ignite.raft.jraft.error.RaftError) LogManagerImpl(org.apache.ignite.raft.jraft.storage.impl.LogManagerImpl) StringUtils(org.apache.ignite.raft.jraft.util.StringUtils) RpcRequestClosure(org.apache.ignite.raft.jraft.rpc.RpcRequestClosure) RaftException(org.apache.ignite.raft.jraft.error.RaftException) RaftMetaStorageOptions(org.apache.ignite.raft.jraft.option.RaftMetaStorageOptions) ArrayList(java.util.ArrayList) Task(org.apache.ignite.raft.jraft.entity.Task) TimeoutStrategy(org.apache.ignite.raft.jraft.util.TimeoutStrategy) SnapshotExecutor(org.apache.ignite.raft.jraft.storage.SnapshotExecutor) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) CatchUpClosure(org.apache.ignite.raft.jraft.closure.CatchUpClosure) BallotBoxOptions(org.apache.ignite.raft.jraft.option.BallotBoxOptions) EventHandler(com.lmax.disruptor.EventHandler) ReadOnlyServiceOptions(org.apache.ignite.raft.jraft.option.ReadOnlyServiceOptions) ReadIndexResponse(org.apache.ignite.raft.jraft.rpc.RpcRequests.ReadIndexResponse) LinkedHashSet(java.util.LinkedHashSet) LogIndexOutOfBoundsException(org.apache.ignite.raft.jraft.error.LogIndexOutOfBoundsException) SystemPropertyUtil(org.apache.ignite.raft.jraft.util.SystemPropertyUtil) TimeoutNowResponse(org.apache.ignite.raft.jraft.rpc.RpcRequests.TimeoutNowResponse) Closure(org.apache.ignite.raft.jraft.Closure) ClosureQueue(org.apache.ignite.raft.jraft.closure.ClosureQueue) LogNotFoundException(org.apache.ignite.raft.jraft.error.LogNotFoundException) DefaultRaftClientService(org.apache.ignite.raft.jraft.rpc.impl.core.DefaultRaftClientService) RaftRpcFactory(org.apache.ignite.raft.jraft.rpc.RaftRpcFactory) Lock(java.util.concurrent.locks.Lock) LogManagerOptions(org.apache.ignite.raft.jraft.option.LogManagerOptions) FSMCaller(org.apache.ignite.raft.jraft.FSMCaller) ReadIndexRequest(org.apache.ignite.raft.jraft.rpc.RpcRequests.ReadIndexRequest) TimeoutNowRequest(org.apache.ignite.raft.jraft.rpc.RpcRequests.TimeoutNowRequest) LeaderChangeContext(org.apache.ignite.raft.jraft.entity.LeaderChangeContext) NamedThreadFactory(org.apache.ignite.internal.thread.NamedThreadFactory) RaftOptions(org.apache.ignite.raft.jraft.option.RaftOptions) RaftServerService(org.apache.ignite.raft.jraft.rpc.RaftServerService) LogManager(org.apache.ignite.raft.jraft.storage.LogManager) ScheduledFuture(java.util.concurrent.ScheduledFuture) EnumOutter(org.apache.ignite.raft.jraft.entity.EnumOutter) Requires(org.apache.ignite.raft.jraft.util.Requires) LogEntry(org.apache.ignite.raft.jraft.entity.LogEntry) IgniteLogger(org.apache.ignite.lang.IgniteLogger) ByteBuffer(java.nio.ByteBuffer) ConfigurationManager(org.apache.ignite.raft.jraft.conf.ConfigurationManager) ReadIndexResponseBuilder(org.apache.ignite.raft.jraft.rpc.ReadIndexResponseBuilder) ReplicatorGroupOptions(org.apache.ignite.raft.jraft.option.ReplicatorGroupOptions) ReadOnlyOption(org.apache.ignite.raft.jraft.option.ReadOnlyOption) AppendEntriesResponseBuilder(org.apache.ignite.raft.jraft.rpc.AppendEntriesResponseBuilder) StripedDisruptor(org.apache.ignite.raft.jraft.disruptor.StripedDisruptor) RpcResponseClosureAdapter(org.apache.ignite.raft.jraft.rpc.RpcResponseClosureAdapter) Node(org.apache.ignite.raft.jraft.Node) LogId(org.apache.ignite.raft.jraft.entity.LogId) ReadOnlyService(org.apache.ignite.raft.jraft.ReadOnlyService) Collection(java.util.Collection) Status(org.apache.ignite.raft.jraft.Status) GroupAware(org.apache.ignite.raft.jraft.disruptor.GroupAware) NodeId(org.apache.ignite.raft.jraft.entity.NodeId) BootstrapOptions(org.apache.ignite.raft.jraft.option.BootstrapOptions) Collectors(java.util.stream.Collectors) OnlyForTest(org.apache.ignite.raft.jraft.util.OnlyForTest) Utils(org.apache.ignite.raft.jraft.util.Utils) List(java.util.List) LogStorage(org.apache.ignite.raft.jraft.storage.LogStorage) LongHeldDetectingReadWriteLock(org.apache.ignite.raft.jraft.util.concurrent.LongHeldDetectingReadWriteLock) RpcResponseClosure(org.apache.ignite.raft.jraft.rpc.RpcResponseClosure) DisruptorMetricSet(org.apache.ignite.raft.jraft.util.DisruptorMetricSet) RaftOutter(org.apache.ignite.raft.jraft.entity.RaftOutter) RequestVoteRequest(org.apache.ignite.raft.jraft.rpc.RpcRequests.RequestVoteRequest) Configuration(org.apache.ignite.raft.jraft.conf.Configuration) ReadIndexClosure(org.apache.ignite.raft.jraft.closure.ReadIndexClosure) NodeOptions(org.apache.ignite.raft.jraft.option.NodeOptions) HashSet(java.util.HashSet) RepeatedTimer(org.apache.ignite.raft.jraft.util.RepeatedTimer) RequestVoteResponse(org.apache.ignite.raft.jraft.rpc.RpcRequests.RequestVoteResponse) JRaftServiceFactory(org.apache.ignite.raft.jraft.JRaftServiceFactory) Describer(org.apache.ignite.raft.jraft.util.Describer) RaftClientService(org.apache.ignite.raft.jraft.rpc.RaftClientService) ClosureQueueImpl(org.apache.ignite.raft.jraft.closure.ClosureQueueImpl) JRaftUtils(org.apache.ignite.raft.jraft.JRaftUtils) RingBuffer(com.lmax.disruptor.RingBuffer) FSMCallerOptions(org.apache.ignite.raft.jraft.option.FSMCallerOptions) RaftMetaStorage(org.apache.ignite.raft.jraft.storage.RaftMetaStorage) ThreadHelper(org.apache.ignite.raft.jraft.util.ThreadHelper) TimeUnit(java.util.concurrent.TimeUnit) PeerId(org.apache.ignite.raft.jraft.entity.PeerId) Peer(org.apache.ignite.raft.client.Peer) Ballot(org.apache.ignite.raft.jraft.entity.Ballot) InstallSnapshotRequest(org.apache.ignite.raft.jraft.rpc.RpcRequests.InstallSnapshotRequest) EventTranslator(com.lmax.disruptor.EventTranslator) UserLog(org.apache.ignite.raft.jraft.entity.UserLog) Message(org.apache.ignite.raft.jraft.rpc.Message) ThreadId(org.apache.ignite.raft.jraft.util.ThreadId) ReplicatorGroup(org.apache.ignite.raft.jraft.ReplicatorGroup) ByteString(org.apache.ignite.raft.jraft.util.ByteString) SynchronizedClosure(org.apache.ignite.raft.jraft.closure.SynchronizedClosure) RpcRequestClosure(org.apache.ignite.raft.jraft.rpc.RpcRequestClosure) CatchUpClosure(org.apache.ignite.raft.jraft.closure.CatchUpClosure) Closure(org.apache.ignite.raft.jraft.Closure) RpcResponseClosure(org.apache.ignite.raft.jraft.rpc.RpcResponseClosure) ReadIndexClosure(org.apache.ignite.raft.jraft.closure.ReadIndexClosure) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) LogEntry(org.apache.ignite.raft.jraft.entity.LogEntry)

Aggregations

Task (org.apache.ignite.raft.jraft.entity.Task)17 Node (org.apache.ignite.raft.jraft.Node)14 PeerId (org.apache.ignite.raft.jraft.entity.PeerId)14 CountDownLatch (java.util.concurrent.CountDownLatch)13 Test (org.junit.jupiter.api.Test)12 ByteBuffer (java.nio.ByteBuffer)11 Status (org.apache.ignite.raft.jraft.Status)9 Endpoint (org.apache.ignite.raft.jraft.util.Endpoint)9 ArrayList (java.util.ArrayList)8 SynchronizedClosure (org.apache.ignite.raft.jraft.closure.SynchronizedClosure)7 Configuration (org.apache.ignite.raft.jraft.conf.Configuration)7 List (java.util.List)5 Collections.synchronizedList (java.util.Collections.synchronizedList)3 HashSet (java.util.HashSet)3 LinkedHashSet (java.util.LinkedHashSet)3 Set (java.util.Set)3 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)3 TimeUnit (java.util.concurrent.TimeUnit)3 Collectors.toList (java.util.stream.Collectors.toList)3 IgniteLogger (org.apache.ignite.lang.IgniteLogger)3