Search in sources :

Example 1 with InMemoryConfiguration

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

the class TestOzoneClient method init.

@Before
public void init() throws IOException {
    ConfigurationSource config = new InMemoryConfiguration();
    client = new OzoneClient(config, new RpcClient(config, null) {

        @Override
        protected OmTransport createOmTransport(String omServiceId) throws IOException {
            return new MockOmTransport();
        }

        @NotNull
        @Override
        protected XceiverClientFactory createXceiverClientFactory(List<X509Certificate> x509Certificates) throws IOException {
            return new MockXceiverClientFactory();
        }
    });
    store = client.getObjectStore();
}
Also used : ConfigurationSource(org.apache.hadoop.hdds.conf.ConfigurationSource) InMemoryConfiguration(org.apache.hadoop.hdds.conf.InMemoryConfiguration) List(java.util.List) RpcClient(org.apache.hadoop.ozone.client.rpc.RpcClient) Before(org.junit.Before)

Example 2 with InMemoryConfiguration

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

the class TestReplicatedFileChecksumHelper method init.

@Before
public void init() throws IOException {
    ConfigurationSource config = new InMemoryConfiguration();
    rpcClient = new RpcClient(config, null) {

        @Override
        protected OmTransport createOmTransport(String omServiceId) throws IOException {
            return new MockOmTransport();
        }

        @NotNull
        @Override
        protected XceiverClientFactory createXceiverClientFactory(List<X509Certificate> x509Certificates) throws IOException {
            return new MockXceiverClientFactory();
        }
    };
    client = new OzoneClient(config, rpcClient);
    store = client.getObjectStore();
}
Also used : ConfigurationSource(org.apache.hadoop.hdds.conf.ConfigurationSource) MockOmTransport(org.apache.hadoop.ozone.client.MockOmTransport) MockOmTransport(org.apache.hadoop.ozone.client.MockOmTransport) OmTransport(org.apache.hadoop.ozone.om.protocolPB.OmTransport) ByteString(org.apache.ratis.thirdparty.com.google.protobuf.ByteString) IOException(java.io.IOException) OzoneClient(org.apache.hadoop.ozone.client.OzoneClient) MockXceiverClientFactory(org.apache.hadoop.ozone.client.MockXceiverClientFactory) XceiverClientFactory(org.apache.hadoop.hdds.scm.XceiverClientFactory) NotNull(org.jetbrains.annotations.NotNull) X509Certificate(java.security.cert.X509Certificate) MockXceiverClientFactory(org.apache.hadoop.ozone.client.MockXceiverClientFactory) InMemoryConfiguration(org.apache.hadoop.hdds.conf.InMemoryConfiguration) RpcClient(org.apache.hadoop.ozone.client.rpc.RpcClient) Before(org.junit.Before)

Example 3 with InMemoryConfiguration

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

the class TestOzoneAddressClientCreation method explicitNonHAHostPort.

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

Example 4 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 5 with InMemoryConfiguration

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

the class TestOzoneAddressClientCreation method implicitNonHA.

@Test
public void implicitNonHA() throws OzoneClientException, IOException {
    TestableOzoneAddress address = new TestableOzoneAddress("/vol1/bucket1/key1");
    address.createClient(new InMemoryConfiguration());
    Assert.assertTrue(address.simpleCreation);
}
Also used : InMemoryConfiguration(org.apache.hadoop.hdds.conf.InMemoryConfiguration) Test(org.junit.Test)

Aggregations

InMemoryConfiguration (org.apache.hadoop.hdds.conf.InMemoryConfiguration)15 Test (org.junit.Test)12 MutableConfigurationSource (org.apache.hadoop.hdds.conf.MutableConfigurationSource)4 ConfigurationSource (org.apache.hadoop.hdds.conf.ConfigurationSource)2 RpcClient (org.apache.hadoop.ozone.client.rpc.RpcClient)2 Before (org.junit.Before)2 IOException (java.io.IOException)1 X509Certificate (java.security.cert.X509Certificate)1 List (java.util.List)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 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