Java Code Examples for org.apache.hadoop.yarn.api.records.FinalApplicationStatus#KILLED
The following examples show how to use
org.apache.hadoop.yarn.api.records.FinalApplicationStatus#KILLED .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: YarnResourceManager.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
/** * Converts a Flink application status enum to a YARN application status enum. * @param status The Flink application status. * @return The corresponding YARN application status. */ private FinalApplicationStatus getYarnStatus(ApplicationStatus status) { if (status == null) { return FinalApplicationStatus.UNDEFINED; } else { switch (status) { case SUCCEEDED: return FinalApplicationStatus.SUCCEEDED; case FAILED: return FinalApplicationStatus.FAILED; case CANCELED: return FinalApplicationStatus.KILLED; default: return FinalApplicationStatus.UNDEFINED; } } }
Example 2
Source File: YarnResourceManager.java From flink with Apache License 2.0 | 6 votes |
/** * Converts a Flink application status enum to a YARN application status enum. * @param status The Flink application status. * @return The corresponding YARN application status. */ private FinalApplicationStatus getYarnStatus(ApplicationStatus status) { if (status == null) { return FinalApplicationStatus.UNDEFINED; } else { switch (status) { case SUCCEEDED: return FinalApplicationStatus.SUCCEEDED; case FAILED: return FinalApplicationStatus.FAILED; case CANCELED: return FinalApplicationStatus.KILLED; default: return FinalApplicationStatus.UNDEFINED; } } }
Example 3
Source File: RMAppImpl.java From hadoop with Apache License 2.0 | 6 votes |
private FinalApplicationStatus createFinalApplicationStatus(RMAppState state) { switch(state) { case NEW: case NEW_SAVING: case SUBMITTED: case ACCEPTED: case RUNNING: case FINAL_SAVING: case KILLING: return FinalApplicationStatus.UNDEFINED; // finished without a proper final state is the same as failed case FINISHING: case FINISHED: case FAILED: return FinalApplicationStatus.FAILED; case KILLED: return FinalApplicationStatus.KILLED; } throw new YarnRuntimeException("Unknown state passed!"); }
Example 4
Source File: TypeConverter.java From hadoop with Apache License 2.0 | 6 votes |
public static State fromYarn(YarnApplicationState yarnApplicationState, FinalApplicationStatus finalApplicationStatus) { switch (yarnApplicationState) { case NEW: case NEW_SAVING: case SUBMITTED: case ACCEPTED: return State.PREP; case RUNNING: return State.RUNNING; case FINISHED: if (finalApplicationStatus == FinalApplicationStatus.SUCCEEDED) { return State.SUCCEEDED; } else if (finalApplicationStatus == FinalApplicationStatus.KILLED) { return State.KILLED; } case FAILED: return State.FAILED; case KILLED: return State.KILLED; } throw new YarnRuntimeException("Unrecognized application state: " + yarnApplicationState); }
Example 5
Source File: RMAppImpl.java From big-c with Apache License 2.0 | 6 votes |
private FinalApplicationStatus createFinalApplicationStatus(RMAppState state) { switch(state) { case NEW: case NEW_SAVING: case SUBMITTED: case ACCEPTED: case RUNNING: case FINAL_SAVING: case KILLING: return FinalApplicationStatus.UNDEFINED; // finished without a proper final state is the same as failed case FINISHING: case FINISHED: case FAILED: return FinalApplicationStatus.FAILED; case KILLED: return FinalApplicationStatus.KILLED; } throw new YarnRuntimeException("Unknown state passed!"); }
Example 6
Source File: TypeConverter.java From big-c with Apache License 2.0 | 6 votes |
public static State fromYarn(YarnApplicationState yarnApplicationState, FinalApplicationStatus finalApplicationStatus) { switch (yarnApplicationState) { case NEW: case NEW_SAVING: case SUBMITTED: case ACCEPTED: return State.PREP; case RUNNING: return State.RUNNING; case FINISHED: if (finalApplicationStatus == FinalApplicationStatus.SUCCEEDED) { return State.SUCCEEDED; } else if (finalApplicationStatus == FinalApplicationStatus.KILLED) { return State.KILLED; } case FAILED: return State.FAILED; case KILLED: return State.KILLED; } throw new YarnRuntimeException("Unrecognized application state: " + yarnApplicationState); }
Example 7
Source File: YarnResourceManager.java From flink with Apache License 2.0 | 6 votes |
/** * Converts a Flink application status enum to a YARN application status enum. * @param status The Flink application status. * @return The corresponding YARN application status. */ private FinalApplicationStatus getYarnStatus(ApplicationStatus status) { if (status == null) { return FinalApplicationStatus.UNDEFINED; } else { switch (status) { case SUCCEEDED: return FinalApplicationStatus.SUCCEEDED; case FAILED: return FinalApplicationStatus.FAILED; case CANCELED: return FinalApplicationStatus.KILLED; default: return FinalApplicationStatus.UNDEFINED; } } }
Example 8
Source File: LocalClient.java From tez with Apache License 2.0 | 6 votes |
protected FinalApplicationStatus convertDAGAppMasterStateToFinalYARNState( DAGAppMasterState dagAppMasterState) { switch (dagAppMasterState) { case NEW: case INITED: case RECOVERING: case IDLE: case RUNNING: return FinalApplicationStatus.UNDEFINED; case SUCCEEDED: return FinalApplicationStatus.SUCCEEDED; case FAILED: return FinalApplicationStatus.FAILED; case KILLED: return FinalApplicationStatus.KILLED; case ERROR: return FinalApplicationStatus.FAILED; default: return FinalApplicationStatus.UNDEFINED; } }
Example 9
Source File: TaskSchedulerEventHandler.java From incubator-tez with Apache License 2.0 | 5 votes |
@Override public AppFinalStatus getFinalAppStatus() { FinalApplicationStatus finishState = FinalApplicationStatus.UNDEFINED; StringBuffer sb = new StringBuffer(); if (dagAppMaster == null) { finishState = FinalApplicationStatus.UNDEFINED; sb.append("App not yet initialized"); } else { DAGAppMasterState appMasterState = dagAppMaster.getState(); if (appMasterState == DAGAppMasterState.SUCCEEDED) { finishState = FinalApplicationStatus.SUCCEEDED; } else if (appMasterState == DAGAppMasterState.KILLED || (appMasterState == DAGAppMasterState.RUNNING && isSignalled)) { finishState = FinalApplicationStatus.KILLED; } else if (appMasterState == DAGAppMasterState.FAILED || appMasterState == DAGAppMasterState.ERROR) { finishState = FinalApplicationStatus.FAILED; } else { finishState = FinalApplicationStatus.UNDEFINED; } List<String> diagnostics = dagAppMaster.getDiagnostics(); if(diagnostics != null) { for (String s : diagnostics) { sb.append(s).append("\n"); } } } if(LOG.isDebugEnabled()) { LOG.debug("Setting job diagnostics to " + sb.toString()); } String historyUrl = ""; /*String historyUrl = JobHistoryUtils.getHistoryUrl(getConfig(), appContext.getApplicationID()); LOG.info("History url is " + historyUrl);*/ return new AppFinalStatus(finishState, sb.toString(), historyUrl); }
Example 10
Source File: TaskSchedulerManager.java From tez with Apache License 2.0 | 5 votes |
public AppFinalStatus getFinalAppStatus() { FinalApplicationStatus finishState = FinalApplicationStatus.UNDEFINED; StringBuffer sb = new StringBuffer(); if (dagAppMaster == null) { finishState = FinalApplicationStatus.UNDEFINED; sb.append("App not yet initialized"); } else { DAGAppMasterState appMasterState = dagAppMaster.getState(); if (appMasterState == DAGAppMasterState.SUCCEEDED) { finishState = FinalApplicationStatus.SUCCEEDED; } else if (appMasterState == DAGAppMasterState.KILLED || (appMasterState == DAGAppMasterState.RUNNING && isSignalled)) { finishState = FinalApplicationStatus.KILLED; } else if (appMasterState == DAGAppMasterState.FAILED || appMasterState == DAGAppMasterState.ERROR) { finishState = FinalApplicationStatus.FAILED; } else { finishState = FinalApplicationStatus.UNDEFINED; } finishState = hadoopShim.applyFinalApplicationStatusCorrection(finishState, dagAppMaster.isSession(), appMasterState == DAGAppMasterState.ERROR); List<String> diagnostics = dagAppMaster.getDiagnostics(); if(diagnostics != null) { for (String s : diagnostics) { sb.append(s).append("\n"); } } } if(LOG.isDebugEnabled()) { LOG.debug("Setting job diagnostics to " + sb.toString()); } // if history url is set use the same, if historyUrl is set to "" then rm ui disables the // history url return new AppFinalStatus(finishState, sb.toString(), historyUrl); }
Example 11
Source File: RMCommunicator.java From hadoop with Apache License 2.0 | 4 votes |
@VisibleForTesting protected void doUnregistration() throws YarnException, IOException, InterruptedException { FinalApplicationStatus finishState = FinalApplicationStatus.UNDEFINED; JobImpl jobImpl = (JobImpl)job; if (jobImpl.getInternalState() == JobStateInternal.SUCCEEDED) { finishState = FinalApplicationStatus.SUCCEEDED; } else if (jobImpl.getInternalState() == JobStateInternal.KILLED || (jobImpl.getInternalState() == JobStateInternal.RUNNING && isSignalled)) { finishState = FinalApplicationStatus.KILLED; } else if (jobImpl.getInternalState() == JobStateInternal.FAILED || jobImpl.getInternalState() == JobStateInternal.ERROR) { finishState = FinalApplicationStatus.FAILED; } StringBuffer sb = new StringBuffer(); for (String s : job.getDiagnostics()) { sb.append(s).append("\n"); } LOG.info("Setting job diagnostics to " + sb.toString()); String historyUrl = MRWebAppUtil.getApplicationWebURLOnJHSWithScheme(getConfig(), context.getApplicationID()); LOG.info("History url is " + historyUrl); FinishApplicationMasterRequest request = FinishApplicationMasterRequest.newInstance(finishState, sb.toString(), historyUrl); try { while (true) { FinishApplicationMasterResponse response = scheduler.finishApplicationMaster(request); if (response.getIsUnregistered()) { // When excepting ClientService, other services are already stopped, // it is safe to let clients know the final states. ClientService // should wait for some time so clients have enough time to know the // final states. RunningAppContext raContext = (RunningAppContext) context; raContext.markSuccessfulUnregistration(); break; } LOG.info("Waiting for application to be successfully unregistered."); Thread.sleep(rmPollInterval); } } catch (ApplicationMasterNotRegisteredException e) { // RM might have restarted or failed over and so lost the fact that AM had // registered before. register(); doUnregistration(); } }
Example 12
Source File: RMCommunicator.java From big-c with Apache License 2.0 | 4 votes |
@VisibleForTesting protected void doUnregistration() throws YarnException, IOException, InterruptedException { FinalApplicationStatus finishState = FinalApplicationStatus.UNDEFINED; JobImpl jobImpl = (JobImpl)job; if (jobImpl.getInternalState() == JobStateInternal.SUCCEEDED) { finishState = FinalApplicationStatus.SUCCEEDED; } else if (jobImpl.getInternalState() == JobStateInternal.KILLED || (jobImpl.getInternalState() == JobStateInternal.RUNNING && isSignalled)) { finishState = FinalApplicationStatus.KILLED; } else if (jobImpl.getInternalState() == JobStateInternal.FAILED || jobImpl.getInternalState() == JobStateInternal.ERROR) { finishState = FinalApplicationStatus.FAILED; } StringBuffer sb = new StringBuffer(); for (String s : job.getDiagnostics()) { sb.append(s).append("\n"); } LOG.info("Setting job diagnostics to " + sb.toString()); String historyUrl = MRWebAppUtil.getApplicationWebURLOnJHSWithScheme(getConfig(), context.getApplicationID()); LOG.info("History url is " + historyUrl); FinishApplicationMasterRequest request = FinishApplicationMasterRequest.newInstance(finishState, sb.toString(), historyUrl); try { while (true) { FinishApplicationMasterResponse response = scheduler.finishApplicationMaster(request); if (response.getIsUnregistered()) { // When excepting ClientService, other services are already stopped, // it is safe to let clients know the final states. ClientService // should wait for some time so clients have enough time to know the // final states. RunningAppContext raContext = (RunningAppContext) context; raContext.markSuccessfulUnregistration(); break; } LOG.info("Waiting for application to be successfully unregistered."); Thread.sleep(rmPollInterval); } } catch (ApplicationMasterNotRegisteredException e) { // RM might have restarted or failed over and so lost the fact that AM had // registered before. register(); doUnregistration(); } }