use of org.apache.hive.service.server.KillQueryImpl in project hive by apache.
the class HiveSessionImpl method open.
@Override
public /**
* Opens a new HiveServer2 session for the client connection.
* Creates a new SessionState object that will be associated with this HiveServer2 session.
* When the server executes multiple queries in the same session,
* this SessionState object is reused across multiple queries.
* Note that if doAs is true, this call goes through a proxy object,
* which wraps the method logic in a UserGroupInformation#doAs.
* That's why it is important to create SessionState here rather than in the constructor.
*/
void open(Map<String, String> sessionConfMap) throws HiveSQLException {
sessionState = new SessionState(sessionConf, username);
sessionState.setUserIpAddress(ipAddress);
sessionState.setIsHiveServerQuery(true);
sessionState.setForwardedAddresses(SessionManager.getForwardedAddresses());
sessionState.setIsUsingThriftJDBCBinarySerDe(updateIsUsingThriftJDBCBinarySerDe());
try {
if (sessionManager != null) {
sessionState.setHiveServer2Host(sessionManager.getHiveServer2HostName());
}
} catch (Exception e) {
throw new HiveSQLException(e);
}
sessionState.setKillQuery(new KillQueryImpl(operationManager));
SessionState.start(sessionState);
try {
sessionState.loadAuxJars();
sessionState.loadReloadableAuxJars();
} catch (IOException e) {
String msg = "Failed to load reloadable jar file path: " + e;
LOG.error(msg, e);
throw new HiveSQLException(msg, e);
}
try {
sessionHive = Hive.get(getHiveConf());
} catch (HiveException e) {
throw new HiveSQLException("Failed to get metastore connection", e);
}
// Process global init file: .hiverc
processGlobalInitFile();
// Set fetch size in session conf map
sessionConfMap = setFetchSize(sessionConfMap);
if (sessionConfMap != null) {
configureSession(sessionConfMap);
}
lastAccessTime = System.currentTimeMillis();
}
Aggregations