Search in sources :

Example 16 with ReconUtils

use of org.apache.hadoop.ozone.recon.ReconUtils in project ozone by apache.

the class AbstractReconContainerManagerTest method setUp.

@Before
public void setUp() throws Exception {
    conf = new OzoneConfiguration();
    conf.set(OZONE_METADATA_DIRS, temporaryFolder.newFolder().getAbsolutePath());
    conf.set(OZONE_SCM_NAMES, "localhost");
    store = DBStoreBuilder.createDBStore(conf, new ReconSCMDBDefinition());
    scmhaManager = MockSCMHAManager.getInstance(true, new MockSCMHADBTransactionBuffer(store));
    sequenceIdGen = new SequenceIdGenerator(conf, scmhaManager, ReconSCMDBDefinition.SEQUENCE_ID.getTable(store));
    scmContext = SCMContext.emptyContext();
    scmStorageConfig = new ReconStorageConfig(conf, new ReconUtils());
    NetworkTopology clusterMap = new NetworkTopologyImpl(conf);
    EventQueue eventQueue = new EventQueue();
    layoutVersionManager = mock(HDDSLayoutVersionManager.class);
    when(layoutVersionManager.getSoftwareLayoutVersion()).thenReturn(maxLayoutVersion());
    when(layoutVersionManager.getMetadataLayoutVersion()).thenReturn(maxLayoutVersion());
    NodeManager nodeManager = new SCMNodeManager(conf, scmStorageConfig, eventQueue, clusterMap, scmContext, layoutVersionManager);
    pipelineManager = ReconPipelineManager.newReconPipelineManager(conf, nodeManager, ReconSCMDBDefinition.PIPELINES.getTable(store), eventQueue, scmhaManager, scmContext);
    containerManager = new ReconContainerManager(conf, store, ReconSCMDBDefinition.CONTAINERS.getTable(store), pipelineManager, getScmServiceProvider(), mock(ContainerHealthSchemaManager.class), mock(ReconContainerMetadataManager.class), scmhaManager, sequenceIdGen);
}
Also used : ReconUtils(org.apache.hadoop.ozone.recon.ReconUtils) OzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration) HDDSLayoutVersionManager(org.apache.hadoop.hdds.upgrade.HDDSLayoutVersionManager) MockSCMHADBTransactionBuffer(org.apache.hadoop.hdds.scm.ha.MockSCMHADBTransactionBuffer) EventQueue(org.apache.hadoop.hdds.server.events.EventQueue) NetworkTopologyImpl(org.apache.hadoop.hdds.scm.net.NetworkTopologyImpl) NodeManager(org.apache.hadoop.hdds.scm.node.NodeManager) SCMNodeManager(org.apache.hadoop.hdds.scm.node.SCMNodeManager) SCMNodeManager(org.apache.hadoop.hdds.scm.node.SCMNodeManager) SequenceIdGenerator(org.apache.hadoop.hdds.scm.ha.SequenceIdGenerator) NetworkTopology(org.apache.hadoop.hdds.scm.net.NetworkTopology) Before(org.junit.Before)

Aggregations

ReconUtils (org.apache.hadoop.ozone.recon.ReconUtils)16 Test (org.junit.Test)11 OzoneConfiguration (org.apache.hadoop.hdds.conf.OzoneConfiguration)7 OMMetadataManager (org.apache.hadoop.ozone.om.OMMetadataManager)6 ReconOMMetadataManager (org.apache.hadoop.ozone.recon.recovery.ReconOMMetadataManager)6 File (java.io.File)5 DBCheckpoint (org.apache.hadoop.hdds.utils.db.DBCheckpoint)5 NetworkTopology (org.apache.hadoop.hdds.scm.net.NetworkTopology)4 NetworkTopologyImpl (org.apache.hadoop.hdds.scm.net.NetworkTopologyImpl)4 EventQueue (org.apache.hadoop.hdds.server.events.EventQueue)4 OzoneManagerSyncMetrics (org.apache.hadoop.ozone.recon.metrics.OzoneManagerSyncMetrics)4 ReconTaskController (org.apache.hadoop.ozone.recon.tasks.ReconTaskController)4 Before (org.junit.Before)4 UUID (java.util.UUID)3 DatanodeDetails (org.apache.hadoop.hdds.protocol.DatanodeDetails)3 MockDatanodeDetails.randomDatanodeDetails (org.apache.hadoop.hdds.protocol.MockDatanodeDetails.randomDatanodeDetails)3 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)3 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 HttpURLConnection (java.net.HttpURLConnection)2