use of org.apache.hadoop.hdds.conf.MutableConfigurationSource in project ozone by apache.
the class TestOMStorage method testGetOmDbDir.
/**
* Test {@link OMStorage#getOmDbDir}.
*/
@Test
public void testGetOmDbDir() {
final File testDir = createTestDir();
final File dbDir = new File(testDir, "omDbDir");
// should be ignored.
final File metaDir = new File(testDir, "metaDir");
final MutableConfigurationSource conf = new OzoneConfiguration();
conf.set(OMConfigKeys.OZONE_OM_DB_DIRS, dbDir.getPath());
conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, metaDir.getPath());
try {
assertEquals(dbDir, OMStorage.getOmDbDir(conf));
// should have been created.
assertTrue(dbDir.exists());
} finally {
FileUtils.deleteQuietly(dbDir);
}
}
use of org.apache.hadoop.hdds.conf.MutableConfigurationSource in project ozone by apache.
the class TestReplicationConfigValidator method testWithoutValidation.
@Test
public void testWithoutValidation() {
MutableConfigurationSource config = new InMemoryConfiguration();
config.set("ozone.replication.allowed-configs", "");
final ReplicationConfigValidator validator = config.getObject(ReplicationConfigValidator.class);
validator.validate(RatisReplicationConfig.getInstance(THREE));
validator.validate(StandaloneReplicationConfig.getInstance(ONE));
}
use of org.apache.hadoop.hdds.conf.MutableConfigurationSource in project ozone by apache.
the class TestReplicationConfigValidator method testCustomValidation.
@Test(expected = IllegalArgumentException.class)
public void testCustomValidation() {
MutableConfigurationSource config = new InMemoryConfiguration();
config.set("ozone.replication.allowed-configs", "RATIS/THREE");
final ReplicationConfigValidator validator = config.getObject(ReplicationConfigValidator.class);
validator.validate(RatisReplicationConfig.getInstance(THREE));
validator.validate(RatisReplicationConfig.getInstance(ONE));
// exception is expected
}
use of org.apache.hadoop.hdds.conf.MutableConfigurationSource in project ozone by apache.
the class TestReplicationConfigValidator method testValidation.
@Test
public void testValidation() {
MutableConfigurationSource config = new InMemoryConfiguration();
final ReplicationConfigValidator validator = config.getObject(ReplicationConfigValidator.class);
validator.validate(RatisReplicationConfig.getInstance(THREE));
validator.validate(RatisReplicationConfig.getInstance(ONE));
validator.validate(StandaloneReplicationConfig.getInstance(THREE));
validator.validate(StandaloneReplicationConfig.getInstance(ONE));
}
use of org.apache.hadoop.hdds.conf.MutableConfigurationSource in project ozone by apache.
the class TestTracingUtil method tracingEnabled.
private static MutableConfigurationSource tracingEnabled() {
MutableConfigurationSource config = new InMemoryConfiguration();
config.setBoolean(ScmConfigKeys.HDDS_TRACING_ENABLED, true);
return config;
}
Aggregations