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);
}
}
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);
}
Aggregations