public void returnToSessionManager() throws Exception { // By default, TezSessionPoolManager handles this for both pool and non-pool session. TezSessionPoolManager.getInstance().returnSession(this); }
public TezSessionState reopen() throws Exception { // By default, TezSessionPoolManager handles this for both pool and non-pool session. return TezSessionPoolManager.getInstance().reopen(this); }
public void destroy() throws Exception { // By default, TezSessionPoolManager handles this for both pool and non-pool session. TezSessionPoolManager.getInstance().destroy(this); }
@Override public void run() { TezJobMonitor.killRunningJobs(); try { // TODO: why does this only kill non-default sessions? // Nothing for workload management since that only deals with default ones. TezSessionPoolManager.getInstance().closeNonDefaultSessions(); } catch (Exception e) { // ignore } } });
@Override public void run() { TezJobMonitor.killRunningJobs(); try { TezSessionPoolManager.getInstance().closeNonDefaultSessions(false); } catch (Exception e) { // ignore } } });
private static TezSessionState getUnmanagedSession( TezSessionState session, HiveConf conf, Set<String> desiredCounters, boolean isWorkLlapNode, final WmContext wmContext) throws Exception { TezSessionPoolManager pm = TezSessionPoolManager.getInstance(); session = pm.getSession(session, conf, false, isWorkLlapNode); desiredCounters.addAll(pm.getTriggerCounterNames()); wmContext.setSubscribedCounters(desiredCounters); session.setWmContext(wmContext); return session; }
private void initAndStartTezSessionPoolManager(final WMFullResourcePlan resourcePlan) { // starting Tez session pool in start here to let parent session state initialize on CliService state, to avoid // SessionState.get() return null during createTezDir try { // will be invoked anyway in TezTask. Doing it early to initialize triggers for non-pool tez session. LOG.info("Initializing tez session pool manager"); tezSessionPoolManager = TezSessionPoolManager.getInstance(); HiveConf hiveConf = getHiveConf(); if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_TEZ_INITIALIZE_DEFAULT_SESSIONS)) { tezSessionPoolManager.setupPool(hiveConf); } else { tezSessionPoolManager.setupNonPool(hiveConf); } tezSessionPoolManager.startPool(hiveConf, resourcePlan); LOG.info("Tez session pool manager initialized."); } catch (Exception e) { throw new ServiceException("Unable to setup tez session pool", e); } }
TezSessionPoolManager.getInstance().reopenSession( sessionState, this.conf, inputOutputJars, true); console.printInfo("Session re-established."); console.printInfo("Dag submit failed due to " + e.getMessage() + " stack trace: " + Arrays.toString(e.getStackTrace()) + " retrying..."); TezSessionPoolManager.getInstance().reopenSession(sessionState, this.conf, inputOutputJars, true); dagClient = sessionState.getSession().submitDAG(dag); } catch (Exception retryException) { TezSessionPoolManager.getInstance().destroySession(sessionState); throw retryException;
LOG.warn("The session: " + session + " has not been opened"); session = TezSessionPoolManager.getInstance().getSession( session, conf, false, getWork().getLlapMode()); ss.setTezSession(session); TezSessionPoolManager.getInstance() .returnSession(session, getWork().getLlapMode()); } catch (Exception e) {
&& ss != null) { TezSessionState session = ss.getTezSession(); TezSessionPoolManager.getInstance().closeIfNotDefault(session, true);
final TezSessionPoolManager pm = TezSessionPoolManager.getInstance(); boolean isActivate = false, isInTest = HiveConf.getBoolVar(conf, ConfVars.HIVE_IN_TEST); if (resourcePlan.getStatus() != null) {
@Override public void run() { for (DAGClient c: shutdownList) { TezJobMonitor.killRunningJobs(); } try { for (TezSessionState s : TezSessionPoolManager.getInstance().getOpenSessions()) { System.err.println("Shutting down tez session."); TezSessionPoolManager.getInstance().close(s, false); } } catch (Exception e) { // ignore } } });
private void initAndStartTezSessionPoolManager(final WMFullResourcePlan resourcePlan) { // starting Tez session pool in start here to let parent session state initialize on CliService state, to avoid // SessionState.get() return null during createTezDir try { // will be invoked anyway in TezTask. Doing it early to initialize triggers for non-pool tez session. LOG.info("Initializing tez session pool manager"); tezSessionPoolManager = TezSessionPoolManager.getInstance(); HiveConf hiveConf = getHiveConf(); if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_TEZ_INITIALIZE_DEFAULT_SESSIONS)) { tezSessionPoolManager.setupPool(hiveConf); } else { tezSessionPoolManager.setupNonPool(hiveConf); } tezSessionPoolManager.startPool(hiveConf, resourcePlan); LOG.info("Tez session pool manager initialized."); } catch (Exception e) { throw new ServiceException("Unable to setup tez session pool", e); } }
TezSessionPoolManager.getInstance().stop(); } catch (Exception e) { LOG.error("Tez session pool manager stop had an error during stop of HiveServer2. "
TezSessionPoolManager.getInstance().stop(); } catch (Exception e) { LOG.error("Tez session pool manager stop had an error during stop of HiveServer2. "
TezSessionPoolManager sessionPool = TezSessionPoolManager.getInstance(); sessionPool.setupPool(hiveConf); sessionPool.startPool();
TezSessionPoolManager sessionPool = TezSessionPoolManager.getInstance(); sessionPool.setupPool(hiveConf); sessionPool.startPool();
DAGClient submit(JobConf conf, DAG dag, Path scratchDir, LocalResource appJarLr, TezSessionState sessionState, List<LocalResource> additionalLr, String[] inputOutputJars, Map<String,LocalResource> inputOutputLocalResources) throws Exception { perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TEZ_SUBMIT_DAG); DAGClient dagClient = null; Map<String, LocalResource> resourceMap = new HashMap<String, LocalResource>(); if (additionalLr != null) { for (LocalResource lr: additionalLr) { if (lr.getType() == LocalResourceType.FILE) { // TEZ AM will only localize FILE (no script operators in the AM) resourceMap.put(utils.getBaseName(lr), lr); } } } try { // ready to start execution on the cluster sessionState.getSession().addAppMasterLocalFiles(resourceMap); dagClient = sessionState.getSession().submitDAG(dag); } catch (SessionNotRunning nr) { console.printInfo("Tez session was closed. Reopening..."); // close the old one, but keep the tmp files around TezSessionPoolManager.getInstance().closeAndOpen(sessionState, this.conf, inputOutputJars, true); console.printInfo("Session re-established."); dagClient = sessionState.getSession().submitDAG(dag); } perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.TEZ_SUBMIT_DAG); return dagClient; }
TezSessionPoolManager.getInstance().close(tezSessionState, false);
session = TezSessionPoolManager.getInstance().getSession(session, conf, false); ss.setTezSession(session); TezSessionPoolManager.getInstance().returnSession(session);