@Override public DAGStatus getDAGStatus(@Nullable Set<StatusGetOpts> statusOptions, long timeout) throws IOException, TezException { synchronized (dagClient) { return dagClient.getDAGStatus(statusOptions, timeout); } }
@Override public VertexStatus getVertexStatus(String vertexName, Set<StatusGetOpts> statusOptions) throws IOException, TezException { synchronized (dagClient) { return dagClient.getVertexStatus(vertexName, statusOptions); } }
@Override public void tryKillDAG() throws IOException, TezException { synchronized (dagClient) { dagClient.tryKillDAG(); } }
private void closeDagClientOnCancellation(DAGClient dagClient) { try { dagClient.tryKillDAG(); LOG.info("Waiting for Tez task to shut down: " + this); dagClient.waitForCompletion(); } catch (Exception ex) { LOG.warn("Failed to shut down TezTask" + this, ex); } closeDagClientWithoutEx(dagClient); }
status = dagClient.getDAGStatus(new HashSet<StatusGetOpts>(), CHECK_INTERVAL); vertexProgressMap = status.getVertexProgress(); DAGStatus.State state = status.getState(); if (!running) { perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.TEZ_SUBMIT_TO_RUNNING); console.printInfo("Status: Running (" + dagClient.getExecutionContext() + ")\n"); this.executionStartTime = System.currentTimeMillis(); running = true; try { console.printInfo("Killing DAG..."); dagClient.tryKillDAG(); } catch (IOException | TezException tezException) {
throws IOException, TezException { Set<StatusGetOpts> opts = EnumSet.of(StatusGetOpts.GET_COUNTERS); DAGStatus dagStatus = dagClient.getDAGStatus( (displayDAGCounters ? opts : null)); Progress progress = dagStatus.getDAGProgress(); /progress.getTotalTaskCount()))); for (String vertexName : vertexNames) { VertexStatus vStatus = dagClient.getVertexStatus(vertexName, (displayVertexCounters ? opts : null)); if (vStatus == null) {
getOpts.add(StatusGetOpts.GET_COUNTERS); DAGStatus dagStatus = dagClient.waitForCompletionWithStatusUpdates(getOpts); if (dagStatus.getState() != DAGStatus.State.SUCCEEDED) { LOG.info("DAG diagnostics: " + dagStatus.getDiagnostics()); return -1; } else { dagStatus = dagClient.getDAGStatus(Sets.newHashSet(StatusGetOpts.GET_COUNTERS)); TezCounter counter = dagStatus.getDAGCounters().findCounter(COUNTER_GROUP_NAME, MISSING_KEY_COUNTER_NAME);
for (; numDags > 0; --numDags) { DAGClient dagClient = tezSession.submitDAG(dag); dagClient.waitForCompletion(); if (!dagClient.getDAGStatus(null).getState().equals(DAGStatus.State.SUCCEEDED)) { return 1;
@Override public String getExecutionContext() { return dagClient.getExecutionContext(); // Don't sync. }
@Override public void close() throws IOException { dagClient.close(); // Don't sync. }
@Override public DAGStatus waitForCompletionWithStatusUpdates(@Nullable Set<StatusGetOpts> statusGetOpts) throws IOException, TezException, InterruptedException { synchronized (dagClient) { return dagClient.waitForCompletionWithStatusUpdates(statusGetOpts); } } }
@Override public DAGStatus waitForCompletion() throws IOException, TezException, InterruptedException { synchronized (dagClient) { return dagClient.waitForCompletion(); } }
status = dagClient.getDAGStatus(opts, checkInterval); if (!running) { perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.TEZ_SUBMIT_TO_RUNNING); console.printInfo("Status: Running (" + dagClient.getExecutionContext() + ")\n"); this.executionStartTime = System.currentTimeMillis(); running = true; failureTimer.now(TimeUnit.SECONDS))); dagClient.tryKillDAG(); } catch (IOException | TezException tezException) {
TezCounters hiveCounters = null; try { hiveCounters = dagClient.getDAGStatus(statusGetOpts).getDAGCounters(); } catch (IOException e) { VertexStatus vertexStatus = null; try { vertexStatus = dagClient.getVertexStatus(vertexName, statusOptions); } catch (IOException e) {
@Override public void shutdown() { super.shutdown(); if (dagClient != null) { LOG.info("Shutting down Tez task " + this); try { dagClient.tryKillDAG(); LOG.info("Waiting for Tez task to shut down: " + this); dagClient.waitForCompletion(); } catch (Exception ex) { LOG.warn("Failed to shut down TezTask" + this, ex); } closeDagClientWithoutEx(); } }
@Override public String getExecutionContext() { return dagClient.getExecutionContext(); // Don't sync. }
@Override public void close() throws IOException { dagClient.close(); // Don't sync. }
@Override public DAGStatus waitForCompletionWithStatusUpdates(@Nullable Set<StatusGetOpts> statusGetOpts) throws IOException, TezException, InterruptedException { synchronized (dagClient) { return dagClient.waitForCompletionWithStatusUpdates(statusGetOpts); } } }
@Override public DAGStatus waitForCompletion() throws IOException, TezException, InterruptedException { synchronized (dagClient) { return dagClient.waitForCompletion(); } }
@Override public DAGStatus getDAGStatus(@Nullable Set<StatusGetOpts> statusOptions) throws IOException, TezException { synchronized (dagClient) { return dagClient.getDAGStatus(statusOptions); } }