new BackgroundWork(getCurrentUGI(), parentSession.getSessionHive(), SessionState.get(), asyncPrepare);
@Override public void runInternal() throws HiveSQLException { setState(OperationState.PENDING); boolean runAsync = shouldRunAsync(); final boolean asyncPrepare = runAsync && HiveConf.getBoolVar(queryState.getConf(), HiveConf.ConfVars.HIVE_SERVER2_ASYNC_EXEC_ASYNC_COMPILE); if (!asyncPrepare) { prepare(queryState); } if (!runAsync) { runQuery(); } else { // We'll pass ThreadLocals in the background thread from the foreground (handler) thread. // 1) ThreadLocal Hive object needs to be set in background thread // 2) The metastore client in Hive is associated with right user. // 3) Current UGI will get used by metastore when metastore is in embedded mode Runnable work = new BackgroundWork(getCurrentUGI(), parentSession.getSessionHive(), SessionState.getPerfLogger(), SessionState.get(), asyncPrepare); try { // This submit blocks if no background threads are available to run this operation Future<?> backgroundHandle = getParentSession().submitBackgroundOperation(work); setBackgroundHandle(backgroundHandle); } catch (RejectedExecutionException rejected) { setState(OperationState.ERROR); throw new HiveSQLException("The background threadpool cannot accept" + " new task for execution, please retry the operation", rejected); } } }
final UserGroupInformation currentUGI = getCurrentUGI(opConfig);
final UserGroupInformation currentUGI = getCurrentUGI(opConfig);
final UserGroupInformation currentUGI = getCurrentUGI(opConfig);
final UserGroupInformation currentUGI = getCurrentUGI(opConfig);