private static void resetRemovedSessionToKill(Map<WmTezSession, KillQueryContext> toKillQuery, KillQueryContext killQueryContext, Map<WmTezSession, GetRequest> toReuse) { toKillQuery.put(killQueryContext.session, killQueryContext); killQueryContext.session.clearWm(); GetRequest req = toReuse.remove(killQueryContext.session); if (req != null) { req.sessionToReuse = null; } }
public void discardSessionOnFailure(WmTezSession session) { if (session == null) return; session.clearWm(); session.setQueryId(null); // We can just restart the session if we have received one. try { tezAmPool.replaceSession(session); } catch (Exception e) { LOG.error("Failed to restart a failed session", e); } }
private void resetAndQueueKill(Map<WmTezSession, KillQueryContext> toKillQuery, KillQueryContext killQueryContext, Map<WmTezSession, GetRequest> toReuse) { WmTezSession toKill = killQueryContext.session; toKillQuery.put(toKill, killQueryContext); // The way this works is, a session in WM pool will move back to tez AM pool on a kill and will get // reassigned back to WM pool on GetRequest based on user pool mapping. Only if we remove the session from active // sessions list of its WM pool will the queue'd GetRequest be processed String poolName = toKill.getPoolName(); if (poolName != null) { PoolState poolState = pools.get(poolName); if (poolState != null) { poolState.getSessions().remove(toKill); Iterator<SessionInitContext> iter = poolState.getInitializingSessions().iterator(); while (iter.hasNext()) { if (iter.next().session == toKill) { iter.remove(); break; } } } } toKill.clearWm(); GetRequest req = toReuse.remove(toKill); if (req != null) { req.sessionToReuse = null; } }
poolsToRedistribute.add(poolName); PoolState pool = pools.get(poolName); session.clearWm(); if (pool != null && pool.sessions.remove(session)) { if (updateMetrics && pool.metrics != null) {
session.clearWm(); session.setQueryId(null); session.setWmContext(null);