use of org.apache.ignite.raft.jraft.entity.LogId in project ignite-3 by apache.
the class FSMCallerTest method setup.
@BeforeEach
public void setup() {
this.fsmCaller = new FSMCallerImpl();
NodeOptions options = new NodeOptions();
executor = JRaftUtils.createExecutor("test-executor-", Utils.cpus());
options.setCommonExecutor(executor);
this.closureQueue = new ClosureQueueImpl(options);
opts = new FSMCallerOptions();
Mockito.when(this.node.getNodeMetrics()).thenReturn(new NodeMetrics(false));
Mockito.when(this.node.getOptions()).thenReturn(options);
opts.setNode(this.node);
opts.setFsm(this.fsm);
opts.setLogManager(this.logManager);
opts.setBootstrapId(new LogId(10, 1));
opts.setClosureQueue(this.closureQueue);
opts.setRaftMessagesFactory(new RaftMessagesFactory());
opts.setGroupId("TestSrv");
opts.setfSMCallerExecutorDisruptor(disruptor = new StripedDisruptor<>("TestFSMDisruptor", 1024, () -> new FSMCallerImpl.ApplyTask(), 1));
assertTrue(this.fsmCaller.init(opts));
}
Aggregations