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));
}
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);
}
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;
}
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;
}
Aggregations