Search in sources :

Example 1 with LegacyHadoopConfigurationSource

use of org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource in project ozone by apache.

the class ContainerTestUtils method createEndpoint.

/**
 * Creates an Endpoint class for testing purpose.
 *
 * @param conf - Conf
 * @param address - InetAddres
 * @param rpcTimeout - rpcTimeOut
 * @return EndPoint
 * @throws Exception
 */
public static EndpointStateMachine createEndpoint(Configuration conf, InetSocketAddress address, int rpcTimeout) throws Exception {
    RPC.setProtocolEngine(conf, StorageContainerDatanodeProtocolPB.class, ProtobufRpcEngine.class);
    long version = RPC.getProtocolVersion(StorageContainerDatanodeProtocolPB.class);
    StorageContainerDatanodeProtocolPB rpcProxy = RPC.getProtocolProxy(StorageContainerDatanodeProtocolPB.class, version, address, UserGroupInformation.getCurrentUser(), conf, NetUtils.getDefaultSocketFactory(conf), rpcTimeout, RetryPolicies.TRY_ONCE_THEN_FAIL).getProxy();
    StorageContainerDatanodeProtocolClientSideTranslatorPB rpcClient = new StorageContainerDatanodeProtocolClientSideTranslatorPB(rpcProxy);
    return new EndpointStateMachine(address, rpcClient, new LegacyHadoopConfigurationSource(conf));
}
Also used : EndpointStateMachine(org.apache.hadoop.ozone.container.common.statemachine.EndpointStateMachine) StorageContainerDatanodeProtocolClientSideTranslatorPB(org.apache.hadoop.ozone.protocolPB.StorageContainerDatanodeProtocolClientSideTranslatorPB) LegacyHadoopConfigurationSource(org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource) StorageContainerDatanodeProtocolPB(org.apache.hadoop.ozone.protocolPB.StorageContainerDatanodeProtocolPB)

Example 2 with LegacyHadoopConfigurationSource

use of org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource in project ozone by apache.

the class BaseHttpServer method loadSslConfiguration.

/**
 * Load HTTPS-related configuration.
 */
public static ConfigurationSource loadSslConfiguration(ConfigurationSource conf) {
    Configuration sslConf = new Configuration(false);
    sslConf.addResource(conf.get(OzoneConfigKeys.OZONE_SERVER_HTTPS_KEYSTORE_RESOURCE_KEY, OzoneConfigKeys.OZONE_SERVER_HTTPS_KEYSTORE_RESOURCE_DEFAULT));
    final String[] reqSslProps = { OzoneConfigKeys.OZONE_SERVER_HTTPS_TRUSTSTORE_LOCATION_KEY, OzoneConfigKeys.OZONE_SERVER_HTTPS_KEYSTORE_LOCATION_KEY, OzoneConfigKeys.OZONE_SERVER_HTTPS_KEYSTORE_PASSWORD_KEY, OzoneConfigKeys.OZONE_SERVER_HTTPS_KEYPASSWORD_KEY };
    // Check if the required properties are included
    for (String sslProp : reqSslProps) {
        if (sslConf.get(sslProp) == null) {
            LOG.warn("SSL config {} is missing. If {} is specified, make sure it " + "is a relative path", sslProp, OzoneConfigKeys.OZONE_SERVER_HTTPS_KEYSTORE_RESOURCE_KEY);
        }
    }
    boolean requireClientAuth = conf.getBoolean(OZONE_CLIENT_HTTPS_NEED_AUTH_KEY, OZONE_CLIENT_HTTPS_NEED_AUTH_DEFAULT);
    sslConf.setBoolean(OZONE_CLIENT_HTTPS_NEED_AUTH_KEY, requireClientAuth);
    return new LegacyHadoopConfigurationSource(sslConf);
}
Also used : LegacyHadoopConfigurationSource(org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource) Configuration(org.apache.hadoop.conf.Configuration)

Example 3 with LegacyHadoopConfigurationSource

use of org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource in project ozone by apache.

the class BasicOzoneFileSystem method getConfSource.

public ConfigurationSource getConfSource() {
    Configuration conf = super.getConf();
    ConfigurationSource source;
    if (conf instanceof OzoneConfiguration) {
        source = (ConfigurationSource) conf;
    } else {
        source = new LegacyHadoopConfigurationSource(conf);
    }
    return source;
}
Also used : LegacyHadoopConfigurationSource(org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource) ConfigurationSource(org.apache.hadoop.hdds.conf.ConfigurationSource) LegacyHadoopConfigurationSource(org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource) Configuration(org.apache.hadoop.conf.Configuration) OzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration) OzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration)

Example 4 with LegacyHadoopConfigurationSource

use of org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource in project ozone by apache.

the class BasicRootedOzoneFileSystem method getConfSource.

public ConfigurationSource getConfSource() {
    Configuration conf = super.getConf();
    ConfigurationSource source;
    if (conf instanceof OzoneConfiguration) {
        source = (ConfigurationSource) conf;
    } else {
        source = new LegacyHadoopConfigurationSource(conf);
    }
    return source;
}
Also used : LegacyHadoopConfigurationSource(org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource) ConfigurationSource(org.apache.hadoop.hdds.conf.ConfigurationSource) LegacyHadoopConfigurationSource(org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource) Configuration(org.apache.hadoop.conf.Configuration) OzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration) OzoneConfiguration(org.apache.hadoop.hdds.conf.OzoneConfiguration)

Aggregations

LegacyHadoopConfigurationSource (org.apache.hadoop.hdds.utils.LegacyHadoopConfigurationSource)4 Configuration (org.apache.hadoop.conf.Configuration)3 ConfigurationSource (org.apache.hadoop.hdds.conf.ConfigurationSource)2 OzoneConfiguration (org.apache.hadoop.hdds.conf.OzoneConfiguration)2 EndpointStateMachine (org.apache.hadoop.ozone.container.common.statemachine.EndpointStateMachine)1 StorageContainerDatanodeProtocolClientSideTranslatorPB (org.apache.hadoop.ozone.protocolPB.StorageContainerDatanodeProtocolClientSideTranslatorPB)1 StorageContainerDatanodeProtocolPB (org.apache.hadoop.ozone.protocolPB.StorageContainerDatanodeProtocolPB)1