public HiveSessionImplwithUGI(SessionHandle sessionHandle, TProtocolVersion protocol, String username, String password, HiveConf hiveConf, String ipAddress, String delegationToken, final List<String> forwardedAddresses) throws HiveSQLException { super(sessionHandle, protocol, username, password, hiveConf, ipAddress, forwardedAddresses); setSessionUGI(username); setDelegationToken(delegationToken); }
private IMetaStoreClient getMetaStoreClient(boolean retryInCaseOfTokenExpiration) throws HiveSQLException { try { return Hive.get(getHiveConf()).getMSC(); } catch (HiveException e) { throw new HiveSQLException("Failed to get metastore connection: " + e, e); } catch(MetaException e1) { if (hmsDelegationTokenStr != null && retryInCaseOfTokenExpiration) { LOG.info("Retrying failed metastore connection: " + e1, e1); Hive.closeCurrent(); try { setDelegationToken(Hive.get(getHiveConf()).getDelegationToken(sessionUgi.getUserName(), getUserName())); } catch (HiveException e2) { throw new HiveSQLException("Error connect metastore to setup impersonation: " + e2, e2); } return getMetaStoreClient(false); } else { throw new HiveSQLException("Failed to get metastore connection: " + e1, e1); } } }
public HiveSessionImplwithUGI(SessionHandle sessionHandle, TProtocolVersion protocol, String username, String password, HiveConf hiveConf, String ipAddress, String delegationToken, final List<String> forwardedAddresses) throws HiveSQLException { super(sessionHandle, protocol, username, password, hiveConf, ipAddress, forwardedAddresses); setSessionUGI(username); setDelegationToken(delegationToken); }
public HiveSessionImplwithUGI(TProtocolVersion protocol, String username, String password, HiveConf hiveConf, String ipAddress, String delegationToken) throws HiveSQLException { super(protocol, username, password, hiveConf, ipAddress); setSessionUGI(username); setDelegationToken(delegationToken); // create a new metastore connection for this particular user session Hive.set(null); try { sessionHive = Hive.get(getHiveConf()); } catch (HiveException e) { throw new HiveSQLException("Failed to setup metastore connection", e); } }
public HiveSessionImplwithUGI(TProtocolVersion protocol, String username, String password, HiveConf hiveConf, String ipAddress, String delegationToken) throws HiveSQLException { super(protocol, username, password, hiveConf, ipAddress); setSessionUGI(username); setDelegationToken(delegationToken); // create a new metastore connection for this particular user session Hive.set(null); try { sessionHive = Hive.get(getHiveConf()); } catch (HiveException e) { throw new HiveSQLException("Failed to setup metastore connection", e); } }
public HiveSessionImplwithUGI(TProtocolVersion protocol, String username, String password, HiveConf hiveConf, String ipAddress, String delegationToken) throws HiveSQLException { super(protocol, username, password, hiveConf, ipAddress); setSessionUGI(username); setDelegationToken(delegationToken); // create a new metastore connection for this particular user session Hive.set(null); try { sessionHive = Hive.get(getHiveConf()); } catch (HiveException e) { throw new HiveSQLException("Failed to setup metastore connection", e); } }
public HiveSessionImplwithUGI(TProtocolVersion protocol, String username, String password, HiveConf hiveConf, String ipAddress, String delegationToken) throws HiveSQLException { super(protocol, username, password, hiveConf, ipAddress); setSessionUGI(username); setDelegationToken(delegationToken); // create a new metastore connection for this particular user session Hive.set(null); try { sessionHive = Hive.get(getHiveConf()); } catch (HiveException e) { throw new HiveSQLException("Failed to setup metastore connection", e); } }
private IMetaStoreClient getMetaStoreClient(boolean retryInCaseOfTokenExpiration) throws HiveSQLException { try { return Hive.get(getHiveConf()).getMSC(); } catch (HiveException e) { throw new HiveSQLException("Failed to get metastore connection: " + e, e); } catch(MetaException e1) { if (hmsDelegationTokenStr != null && retryInCaseOfTokenExpiration) { LOG.info("Retrying failed metastore connection: " + e1, e1); Hive.closeCurrent(); try { setDelegationToken(Hive.get(getHiveConf()).getDelegationToken(sessionUgi.getUserName(), getUserName())); } catch (HiveException e2) { throw new HiveSQLException("Error connect metastore to setup impersonation: " + e2, e2); } return getMetaStoreClient(false); } else { throw new HiveSQLException("Failed to get metastore connection: " + e1, e1); } } }