Search in sources :

Example 1 with ReconDBDefinition

use of org.apache.hadoop.ozone.recon.spi.impl.ReconDBDefinition in project ozone by apache.

the class TestDBDefinitionFactory method testGetDefinition.

@Test
public void testGetDefinition() {
    DBDefinition definition = DBDefinitionFactory.getDefinition(new OMDBDefinition().getName());
    assertTrue(definition instanceof OMDBDefinition);
    definition = DBDefinitionFactory.getDefinition(new SCMDBDefinition().getName());
    assertTrue(definition instanceof SCMDBDefinition);
    definition = DBDefinitionFactory.getDefinition(new ReconSCMDBDefinition().getName());
    assertTrue(definition instanceof ReconSCMDBDefinition);
    definition = DBDefinitionFactory.getDefinition(RECON_OM_SNAPSHOT_DB + "_1");
    assertTrue(definition instanceof OMDBDefinition);
    definition = DBDefinitionFactory.getDefinition(RECON_CONTAINER_KEY_DB + "_1");
    assertTrue(definition instanceof ReconDBDefinition);
    DBDefinitionFactory.setDnDBSchemaVersion("V2");
    definition = DBDefinitionFactory.getDefinition(Paths.get("/tmp/test-container.db"));
    assertTrue(definition instanceof DatanodeSchemaTwoDBDefinition);
    DBDefinitionFactory.setDnDBSchemaVersion("V1");
    definition = DBDefinitionFactory.getDefinition(Paths.get("/tmp/test-container.db"));
    assertTrue(definition instanceof DatanodeSchemaOneDBDefinition);
}
Also used : ReconSCMDBDefinition(org.apache.hadoop.ozone.recon.scm.ReconSCMDBDefinition) DatanodeSchemaOneDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaOneDBDefinition) SCMDBDefinition(org.apache.hadoop.hdds.scm.metadata.SCMDBDefinition) DatanodeSchemaTwoDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaTwoDBDefinition) ReconDBDefinition(org.apache.hadoop.ozone.recon.spi.impl.ReconDBDefinition) DBDefinition(org.apache.hadoop.hdds.utils.db.DBDefinition) OMDBDefinition(org.apache.hadoop.ozone.om.codec.OMDBDefinition) OMDBDefinition(org.apache.hadoop.ozone.om.codec.OMDBDefinition) DatanodeSchemaTwoDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaTwoDBDefinition) ReconSCMDBDefinition(org.apache.hadoop.ozone.recon.scm.ReconSCMDBDefinition) SCMDBDefinition(org.apache.hadoop.hdds.scm.metadata.SCMDBDefinition) ReconSCMDBDefinition(org.apache.hadoop.ozone.recon.scm.ReconSCMDBDefinition) ReconDBDefinition(org.apache.hadoop.ozone.recon.spi.impl.ReconDBDefinition) DatanodeSchemaOneDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaOneDBDefinition) Test(org.junit.Test)

Aggregations

SCMDBDefinition (org.apache.hadoop.hdds.scm.metadata.SCMDBDefinition)1 DBDefinition (org.apache.hadoop.hdds.utils.db.DBDefinition)1 DatanodeSchemaOneDBDefinition (org.apache.hadoop.ozone.container.metadata.DatanodeSchemaOneDBDefinition)1 DatanodeSchemaTwoDBDefinition (org.apache.hadoop.ozone.container.metadata.DatanodeSchemaTwoDBDefinition)1 OMDBDefinition (org.apache.hadoop.ozone.om.codec.OMDBDefinition)1 ReconSCMDBDefinition (org.apache.hadoop.ozone.recon.scm.ReconSCMDBDefinition)1 ReconDBDefinition (org.apache.hadoop.ozone.recon.spi.impl.ReconDBDefinition)1 Test (org.junit.Test)1