Search in sources :

Example 21 with RaftOptions

use of org.apache.ignite.raft.jraft.option.RaftOptions in project ignite-3 by apache.

the class CopySessionTest method setup.

@BeforeEach
public void setup() {
    this.timerManager = new TimerManager(5);
    this.copyOpts = new CopyOptions();
    this.raftOpts = new RaftOptions();
    this.rb = raftOpts.getRaftMessagesFactory().getFileRequest().readerId(99).filename("data");
    this.nodeOptions = new NodeOptions();
    this.nodeOptions.setCommonExecutor(Executors.newSingleThreadExecutor());
    this.session = new CopySession(rpcService, timerManager, null, raftOpts, this.nodeOptions, rb, address);
    this.session.setCopyOptions(copyOpts);
}
Also used : RaftOptions(org.apache.ignite.raft.jraft.option.RaftOptions) CopyOptions(org.apache.ignite.raft.jraft.option.CopyOptions) NodeOptions(org.apache.ignite.raft.jraft.option.NodeOptions) TimerManager(org.apache.ignite.raft.jraft.core.TimerManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 22 with RaftOptions

use of org.apache.ignite.raft.jraft.option.RaftOptions in project ignite-3 by apache.

the class RemoteFileCopierTest method testInitFail.

@Test
public void testInitFail() {
    Mockito.when(rpcService.connect(new Endpoint("localhost", 8081))).thenReturn(false);
    assertFalse(copier.init("remote://localhost:8081/999", null, new SnapshotCopierOptions(rpcService, timerManager, new RaftOptions(), new NodeOptions())));
}
Also used : RaftOptions(org.apache.ignite.raft.jraft.option.RaftOptions) SnapshotCopierOptions(org.apache.ignite.raft.jraft.option.SnapshotCopierOptions) Endpoint(org.apache.ignite.raft.jraft.util.Endpoint) NodeOptions(org.apache.ignite.raft.jraft.option.NodeOptions) Test(org.junit.jupiter.api.Test)

Example 23 with RaftOptions

use of org.apache.ignite.raft.jraft.option.RaftOptions in project ignite-3 by apache.

the class BaseNodeRequestProcessorTest method setup.

@BeforeEach
public void setup() {
    Mockito.lenient().when(node.getRaftOptions()).thenReturn(new RaftOptions());
    this.asyncContext = new MockAsyncContext();
}
Also used : RaftOptions(org.apache.ignite.raft.jraft.option.RaftOptions) MockAsyncContext(org.apache.ignite.raft.jraft.test.MockAsyncContext) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

RaftOptions (org.apache.ignite.raft.jraft.option.RaftOptions)23 BeforeEach (org.junit.jupiter.api.BeforeEach)12 Test (org.junit.jupiter.api.Test)11 NodeOptions (org.apache.ignite.raft.jraft.option.NodeOptions)8 Endpoint (org.apache.ignite.raft.jraft.util.Endpoint)8 PeerId (org.apache.ignite.raft.jraft.entity.PeerId)6 LocalFileMetaOutter (org.apache.ignite.raft.jraft.entity.LocalFileMetaOutter)4 File (java.io.File)3 ByteBuffer (java.nio.ByteBuffer)3 TimerManager (org.apache.ignite.raft.jraft.core.TimerManager)3 CopyOptions (org.apache.ignite.raft.jraft.option.CopyOptions)3 SnapshotCopierOptions (org.apache.ignite.raft.jraft.option.SnapshotCopierOptions)3 CompletableFuture (java.util.concurrent.CompletableFuture)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 ExecutorService (java.util.concurrent.ExecutorService)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 Node (org.apache.ignite.raft.jraft.Node)2 ConfigurationManager (org.apache.ignite.raft.jraft.conf.ConfigurationManager)2 RpcClientEx (org.apache.ignite.raft.jraft.rpc.RpcClientEx)2