private void closeClient(TezClient client) throws TezException, IOException { try { client.stop(); } catch (SessionNotRunning nr) { // ignore } }
private void closeClient(TezClient client) throws TezException, IOException { try { client.stop(); } catch (SessionNotRunning nr) { // ignore } }
private static void closeAndIgnoreExceptions(TezClient session) { try { session.stop(); } catch (SessionNotRunning nr) { // Ignore. } catch (IOException | TezException ex) { LOG.info("Failed to close Tez session after failure to initialize: " + ex.getMessage()); } }
private static void closeAndIgnoreExceptions(TezClient session) { try { session.stop(); } catch (SessionNotRunning nr) { // Ignore. } catch (IOException | TezException ex) { LOG.info("Failed to close Tez session after failure to initialize: " + ex.getMessage()); } }
@Override public Boolean call() throws Exception { tezClient.stop(); return true; } }, 5, TimeUnit.MINUTES );
@Override public Boolean call() throws Exception { tezClient.stop(); return true; } }, 5, TimeUnit.MINUTES );
public void killJob() throws IOException { try { if (dagClient != null) { dagClient.tryKillDAG(); } if (tezClient != null) { tezClient.stop(); } } catch (TezException e) { throw new IOException("Cannot kill DAG - Application Id: " + appId, e); } }
+ ", sessionName=" + session.getClientName() + ", applicationId=" + session.getAppMasterApplicationId()); session.stop(); sessionToRemove = sessionInfo; break;
+ ", sessionName=" + session.getClientName() + ", applicationId=" + session.getAppMasterApplicationId()); session.stop(); } catch (Exception e) { log.error("Error shutting down Tez session "
if (shutdown == true) { log.info("Shutting down Tez session " + newSession.session); newSession.session.stop(); throw new IOException("TezSessionManager is shut down");
/** * Close a tez session. Will cleanup any tez/am related resources. After closing a session * no further DAGs can be executed against it. * @param keepTmpDir whether or not to remove the scratch dir at the same time. * @throws IOException * @throws TezException */ public void close(boolean keepTmpDir) throws TezException, IOException { if (!isOpen()) { return; } LOG.info("Closing Tez Session"); try { session.stop(); } catch (SessionNotRunning nr) { // ignore } if (!keepTmpDir) { cleanupScratchDir(); } session = null; tezScratchDir = null; conf = null; appJarLr = null; additionalFilesNotFromConf.clear(); localizedResources.clear(); }
tezSession.stop();
} finally { fs.delete(stagingDir, true); tezSession.stop();
private void stopTezClient() { try { if( tezClient == null ) return; if( isRemoteExecution() ) { tezClient.stop(); // will shutdown the session return; } // the Tez LocalClient will frequently hang on #stop(), this causes tests to never complete Boolean result = Util.submitWithTimeout( new Callable<Boolean>() { @Override public Boolean call() throws Exception { tezClient.stop(); return true; } }, 5, TimeUnit.MINUTES ); if( result == null || !result ) flowStep.logWarn( "tezClient#stop() timed out after 5 minutes, cancelling call, continuing" ); } catch( Exception exception ) { flowStep.logWarn( "exception during attempt to cleanup client", exception ); } }
private void stopTezClient() { try { if( tezClient == null ) return; if( isRemoteExecution() ) { tezClient.stop(); // will shutdown the session return; } // the Tez LocalClient will frequently hang on #stop(), this causes tests to never complete Boolean result = Util.submitWithTimeout( new Callable<Boolean>() { @Override public Boolean call() throws Exception { tezClient.stop(); return true; } }, 5, TimeUnit.MINUTES ); if( result == null || !result ) flowStep.logWarn( "tezClient#stop() timed out after 5 minutes, cancelling call, continuing" ); } catch( Exception exception ) { flowStep.logWarn( "exception during attempt to cleanup client", exception ); } }
} finally { fs.delete(stagingDir, true); tezSession.stop();
private static SessionInfo createSession(TezConfiguration amConf, Map<String, LocalResource> requestedAMResources, Credentials creds, TezJobConfig tezJobConf) throws TezException, IOException, InterruptedException { MRToTezHelper.translateMRSettingsForTezAM(amConf); TezScriptState ss = TezScriptState.get(); ss.addDAGSettingsToConf(amConf); if (amConf.getBoolean(PigConfiguration.PIG_TEZ_CONFIGURE_AM_MEMORY, true)) { adjustAMConfig(amConf, tezJobConf); } String jobName = amConf.get(PigContext.JOB_NAME, "pig"); TezClient tezClient = TezClient.create(jobName, amConf, true, requestedAMResources, creds); try { tezClient.start(); TezAppMasterStatus appMasterStatus = tezClient.getAppMasterStatus(); if (appMasterStatus.equals(TezAppMasterStatus.SHUTDOWN)) { throw new RuntimeException("TezSession has already shutdown"); } tezClient.waitTillReady(); } catch (Throwable e) { log.error("Exception while waiting for Tez client to be ready", e); tezClient.stop(); throw new RuntimeException(e); } return new SessionInfo(tezClient, amConf, requestedAMResources); }
} finally { if (ownTezClient && tezClientInternal != null) { tezClientInternal.stop();
tezSession.stop();
try { LOG.warn("DAG submission to session timed out, stopping session"); stop(); } catch (Throwable t) { LOG.info("Got an exception when trying to stop session", t);