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