Search in sources :

Example 1 with ConfigurationSource

use of org.apache.hadoop.hdds.conf.ConfigurationSource 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 ConfigurationSource

use of org.apache.hadoop.hdds.conf.ConfigurationSource 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 ConfigurationSource

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

the class GeneratorScm method call.

@Override
public Void call() throws Exception {
    init();
    ConfigurationSource config = createOzoneConfiguration();
    scmDb = DBStoreBuilder.createDBStore(config, new SCMDBDefinition());
    containerStore = CONTAINERS.getTable(scmDb);
    timer = getMetrics().timer("scm-generator");
    runTests(this::writeScmData);
    scmDb.close();
    return null;
}
Also used : ConfigurationSource(org.apache.hadoop.hdds.conf.ConfigurationSource) SCMDBDefinition(org.apache.hadoop.hdds.scm.metadata.SCMDBDefinition)

Example 4 with ConfigurationSource

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

the class TestReplicationConfig method testParseFromTypeAndFactorAsString.

@Test
public void testParseFromTypeAndFactorAsString() {
    ConfigurationSource conf = new OzoneConfiguration();
    ReplicationConfig replicationConfig = ReplicationConfig.parse(org.apache.hadoop.hdds.client.ReplicationType.valueOf(type), factor, conf);
    validate(replicationConfig, org.apache.hadoop.hdds.client.ReplicationType.valueOf(type), org.apache.hadoop.hdds.client.ReplicationFactor.valueOf(factor));
}
Also used : ConfigurationSource(org.apache.hadoop.hdds.conf.ConfigurationSource) OzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration) Test(org.junit.Test)

Example 5 with ConfigurationSource

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

the class TestReplicationConfig method testParseFromTypeAndFactorAsStringifiedInteger.

@Test
public void testParseFromTypeAndFactorAsStringifiedInteger() {
    ConfigurationSource conf = new OzoneConfiguration();
    String f = factor == "ONE" ? "1" : factor == "THREE" ? "3" : "Test adjustment needed!";
    ReplicationConfig replicationConfig = ReplicationConfig.parse(org.apache.hadoop.hdds.client.ReplicationType.valueOf(type), f, conf);
    validate(replicationConfig, org.apache.hadoop.hdds.client.ReplicationType.valueOf(type), org.apache.hadoop.hdds.client.ReplicationFactor.valueOf(this.factor));
}
Also used : ConfigurationSource(org.apache.hadoop.hdds.conf.ConfigurationSource) OzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration) Test(org.junit.Test)

Aggregations

ConfigurationSource (org.apache.hadoop.hdds.conf.ConfigurationSource)19 OzoneConfiguration (org.apache.hadoop.hdds.conf.OzoneConfiguration)8 LegacyHadoopConfigurationSource (org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource)8 Test (org.junit.Test)5 IOException (java.io.IOException)4 MutableConfigurationSource (org.apache.hadoop.hdds.conf.MutableConfigurationSource)4 Before (org.junit.Before)3 URISyntaxException (java.net.URISyntaxException)2 List (java.util.List)2 Configuration (org.apache.hadoop.conf.Configuration)2 Path (org.apache.hadoop.fs.Path)2 InMemoryConfiguration (org.apache.hadoop.hdds.conf.InMemoryConfiguration)2 RpcClient (org.apache.hadoop.ozone.client.rpc.RpcClient)2 URIBuilder (org.apache.http.client.utils.URIBuilder)2 File (java.io.File)1 URI (java.net.URI)1 Path (java.nio.file.Path)1 X509Certificate (java.security.cert.X509Certificate)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1