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