Search in sources :

Example 1 with PipelineFactory

use of org.apache.hadoop.hdds.scm.pipeline.PipelineFactory in project ozone by apache.

the class TestReconPipelineManager method testStubbedReconPipelineFactory.

@Test
public void testStubbedReconPipelineFactory() throws IOException {
    NodeManager nodeManagerMock = mock(NodeManager.class);
    ReconPipelineManager reconPipelineManager = ReconPipelineManager.newReconPipelineManager(conf, nodeManagerMock, ReconSCMDBDefinition.PIPELINES.getTable(store), new EventQueue(), scmhaManager, scmContext);
    PipelineFactory pipelineFactory = reconPipelineManager.getPipelineFactory();
    assertTrue(pipelineFactory instanceof ReconPipelineFactory);
    ReconPipelineFactory reconPipelineFactory = (ReconPipelineFactory) pipelineFactory;
    assertTrue(reconPipelineFactory.getProviders().isEmpty());
    for (ReplicationType type : reconPipelineFactory.getProviders().keySet()) {
        PipelineProvider pipelineProvider = reconPipelineFactory.getProviders().get(type);
        assertTrue(pipelineProvider instanceof ReconPipelineProvider);
    }
}
Also used : NodeManager(org.apache.hadoop.hdds.scm.node.NodeManager) SCMNodeManager(org.apache.hadoop.hdds.scm.node.SCMNodeManager) ReplicationType(org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType) PipelineFactory(org.apache.hadoop.hdds.scm.pipeline.PipelineFactory) ReconPipelineProvider(org.apache.hadoop.ozone.recon.scm.ReconPipelineFactory.ReconPipelineProvider) ReconPipelineProvider(org.apache.hadoop.ozone.recon.scm.ReconPipelineFactory.ReconPipelineProvider) PipelineProvider(org.apache.hadoop.hdds.scm.pipeline.PipelineProvider) EventQueue(org.apache.hadoop.hdds.server.events.EventQueue) Test(org.junit.Test)

Example 2 with PipelineFactory

use of org.apache.hadoop.hdds.scm.pipeline.PipelineFactory in project ozone by apache.

the class ReconPipelineManager method newReconPipelineManager.

public static ReconPipelineManager newReconPipelineManager(ConfigurationSource conf, NodeManager nodeManager, Table<PipelineID, Pipeline> pipelineStore, EventPublisher eventPublisher, SCMHAManager scmhaManager, SCMContext scmContext) throws IOException {
    // Create PipelineStateManagerImpl
    PipelineStateManager stateManager = PipelineStateManagerImpl.newBuilder().setPipelineStore(pipelineStore).setNodeManager(nodeManager).setRatisServer(scmhaManager.getRatisServer()).setSCMDBTransactionBuffer(scmhaManager.getDBTransactionBuffer()).build();
    // Create PipelineFactory
    PipelineFactory pipelineFactory = new ReconPipelineFactory();
    return new ReconPipelineManager(conf, scmhaManager, nodeManager, stateManager, pipelineFactory, eventPublisher, scmContext);
}
Also used : PipelineStateManager(org.apache.hadoop.hdds.scm.pipeline.PipelineStateManager) PipelineFactory(org.apache.hadoop.hdds.scm.pipeline.PipelineFactory)

Aggregations

PipelineFactory (org.apache.hadoop.hdds.scm.pipeline.PipelineFactory)2 ReplicationType (org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationType)1 NodeManager (org.apache.hadoop.hdds.scm.node.NodeManager)1 SCMNodeManager (org.apache.hadoop.hdds.scm.node.SCMNodeManager)1 PipelineProvider (org.apache.hadoop.hdds.scm.pipeline.PipelineProvider)1 PipelineStateManager (org.apache.hadoop.hdds.scm.pipeline.PipelineStateManager)1 EventQueue (org.apache.hadoop.hdds.server.events.EventQueue)1 ReconPipelineProvider (org.apache.hadoop.ozone.recon.scm.ReconPipelineFactory.ReconPipelineProvider)1 Test (org.junit.Test)1