Search in sources :

Example 1 with KerberosHttpClient

use of org.apache.hadoop.hive.druid.security.KerberosHttpClient in project hive by apache.

the class DruidStorageHandler method makeHttpClient.

private static HttpClient makeHttpClient(Lifecycle lifecycle) {
    final int numConnection = HiveConf.getIntVar(SessionState.getSessionConf(), HiveConf.ConfVars.HIVE_DRUID_NUM_HTTP_CONNECTION);
    final Period readTimeout = new Period(HiveConf.getVar(SessionState.getSessionConf(), HiveConf.ConfVars.HIVE_DRUID_HTTP_READ_TIMEOUT));
    LOG.info("Creating Druid HTTP client with {} max parallel connections and {}ms read timeout", numConnection, readTimeout.toStandardDuration().getMillis());
    final HttpClient httpClient = HttpClientInit.createClient(HttpClientConfig.builder().withNumConnections(numConnection).withReadTimeout(new Period(readTimeout).toStandardDuration()).build(), lifecycle);
    if (UserGroupInformation.isSecurityEnabled()) {
        LOG.info("building Kerberos Http Client");
        return new KerberosHttpClient(httpClient);
    }
    return httpClient;
}
Also used : KerberosHttpClient(org.apache.hadoop.hive.druid.security.KerberosHttpClient) HttpClient(com.metamx.http.client.HttpClient) KerberosHttpClient(org.apache.hadoop.hive.druid.security.KerberosHttpClient) Period(org.joda.time.Period)

Aggregations

HttpClient (com.metamx.http.client.HttpClient)1 KerberosHttpClient (org.apache.hadoop.hive.druid.security.KerberosHttpClient)1 Period (org.joda.time.Period)1