@Override public CLIServiceClient getClient() throws LensException { if (!connected) { try { log.info("HiveDriver connecting to HiveServer @ {}:{}", conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST), conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT)); hs2Client = RetryingThriftCLIServiceClient.newRetryingCLIServiceClient(conf); log.info("HiveDriver connected to HiveServer @ {}:{}", conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST), conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT)); } catch (HiveSQLException e) { throw new LensException(e); } connected = true; } return hs2Client; }
@Override public CLIServiceClient getClient() throws LensException { if (!connected) { try { log.info("HiveDriver connecting to HiveServer @ {}:{}", conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST), conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT)); if (conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION) .equals(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { hs2Client = RetryingThriftCLIServiceClientSasl.newRetryingCLIServiceClient(conf); } else { hs2Client = RetryingThriftCLIServiceClient.newRetryingCLIServiceClient(conf); } log.info("HiveDriver connected to HiveServer @ {}:{}", conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST), conf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_PORT)); } catch (Exception e) { throw new LensException(e); } connected = true; } return hs2Client; }