use of org.apache.ignite.raft.jraft.core.NodeMetrics in project ignite-3 by apache.
the class LogManagerTest method setup.
@BeforeEach
public void setup() throws Exception {
this.confManager = new ConfigurationManager();
this.raftOptions = new RaftOptions();
this.logStorage = newLogStorage(raftOptions);
this.logManager = new LogManagerImpl();
final LogManagerOptions opts = new LogManagerOptions();
NodeOptions nodeOptions = new NodeOptions();
executor = JRaftUtils.createExecutor("test-executor", Utils.cpus());
nodeOptions.setCommonExecutor(executor);
Mockito.when(node.getOptions()).thenReturn(nodeOptions);
opts.setConfigurationManager(this.confManager);
opts.setLogEntryCodecFactory(LogEntryV1CodecFactory.getInstance());
opts.setFsmCaller(this.fsmCaller);
opts.setNode(node);
opts.setNodeMetrics(new NodeMetrics(false));
opts.setLogStorage(this.logStorage);
opts.setRaftOptions(raftOptions);
opts.setGroupId("TestSrv");
opts.setLogManagerDisruptor(disruptor = new StripedDisruptor<>("TestLogManagerDisruptor", 1024, () -> new LogManagerImpl.StableClosureEvent(), 1));
assertTrue(this.logManager.init(opts));
}
Aggregations