Search in sources :

Example 1 with NodeMetrics

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));
}
Also used : RaftOptions(org.apache.ignite.raft.jraft.option.RaftOptions) NodeMetrics(org.apache.ignite.raft.jraft.core.NodeMetrics) LogManagerOptions(org.apache.ignite.raft.jraft.option.LogManagerOptions) NodeOptions(org.apache.ignite.raft.jraft.option.NodeOptions) ConfigurationManager(org.apache.ignite.raft.jraft.conf.ConfigurationManager) StripedDisruptor(org.apache.ignite.raft.jraft.disruptor.StripedDisruptor) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ConfigurationManager (org.apache.ignite.raft.jraft.conf.ConfigurationManager)1 NodeMetrics (org.apache.ignite.raft.jraft.core.NodeMetrics)1 StripedDisruptor (org.apache.ignite.raft.jraft.disruptor.StripedDisruptor)1 LogManagerOptions (org.apache.ignite.raft.jraft.option.LogManagerOptions)1 NodeOptions (org.apache.ignite.raft.jraft.option.NodeOptions)1 RaftOptions (org.apache.ignite.raft.jraft.option.RaftOptions)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1