Search in sources :

Example 6 with InMemoryConfiguration

use of org.apache.hadoop.hdds.conf.InMemoryConfiguration in project ozone by apache.

the class TestOzoneAddressClientCreation method explicitHAHostPort.

@Test
public void explicitHAHostPort() throws OzoneClientException, IOException {
    TestableOzoneAddress address = new TestableOzoneAddress("o3://om:1234/vol1/bucket1/key1");
    address.createClient(new InMemoryConfiguration());
    Assert.assertFalse(address.simpleCreation);
    Assert.assertEquals("om", address.host);
    Assert.assertEquals(1234, address.port);
}
Also used : InMemoryConfiguration(org.apache.hadoop.hdds.conf.InMemoryConfiguration) Test(org.junit.Test)

Example 7 with InMemoryConfiguration

use of org.apache.hadoop.hdds.conf.InMemoryConfiguration 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;
}
Also used : InMemoryConfiguration(org.apache.hadoop.hdds.conf.InMemoryConfiguration) MutableConfigurationSource(org.apache.hadoop.hdds.conf.MutableConfigurationSource)

Example 8 with InMemoryConfiguration

use of org.apache.hadoop.hdds.conf.InMemoryConfiguration 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));
}
Also used : InMemoryConfiguration(org.apache.hadoop.hdds.conf.InMemoryConfiguration) MutableConfigurationSource(org.apache.hadoop.hdds.conf.MutableConfigurationSource) Test(org.junit.Test)

Example 9 with InMemoryConfiguration

use of org.apache.hadoop.hdds.conf.InMemoryConfiguration 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
}
Also used : InMemoryConfiguration(org.apache.hadoop.hdds.conf.InMemoryConfiguration) MutableConfigurationSource(org.apache.hadoop.hdds.conf.MutableConfigurationSource) Test(org.junit.Test)

Example 10 with InMemoryConfiguration

use of org.apache.hadoop.hdds.conf.InMemoryConfiguration in project ozone by apache.

the class TestOzoneAddressClientCreation method explicitWrongScheme.

@Test(expected = OzoneClientException.class)
public void explicitWrongScheme() throws OzoneClientException, IOException {
    TestableOzoneAddress address = new TestableOzoneAddress("ssh://host/vol1/bucket1/key1");
    address.createClient(new InMemoryConfiguration());
}
Also used : InMemoryConfiguration(org.apache.hadoop.hdds.conf.InMemoryConfiguration) Test(org.junit.Test)

Aggregations

InMemoryConfiguration (org.apache.hadoop.hdds.conf.InMemoryConfiguration)14 Test (org.junit.Test)12 MutableConfigurationSource (org.apache.hadoop.hdds.conf.MutableConfigurationSource)4 IOException (java.io.IOException)1 X509Certificate (java.security.cert.X509Certificate)1 ConfigurationSource (org.apache.hadoop.hdds.conf.ConfigurationSource)1 XceiverClientFactory (org.apache.hadoop.hdds.scm.XceiverClientFactory)1 MockOmTransport (org.apache.hadoop.ozone.client.MockOmTransport)1 MockXceiverClientFactory (org.apache.hadoop.ozone.client.MockXceiverClientFactory)1 OzoneClient (org.apache.hadoop.ozone.client.OzoneClient)1 RpcClient (org.apache.hadoop.ozone.client.rpc.RpcClient)1 OmTransport (org.apache.hadoop.ozone.om.protocolPB.OmTransport)1 ByteString (org.apache.ratis.thirdparty.com.google.protobuf.ByteString)1 NotNull (org.jetbrains.annotations.NotNull)1 Before (org.junit.Before)1