use of com.microsoft.frameworklauncher.common.exit.ExitStatusKey in project pai by Microsoft.
the class ApplicationMaster method stopForContainer.
private void stopForContainer(int exitCode, String diagnostics, String customizedDiagnostics) {
ExitStatusValue partialValue = new ExitStatusValue(exitCode, diagnostics, null);
String fullDiagnostics = ExitDiagnostics.generateDiagnostics(partialValue, customizedDiagnostics);
ExitStatusKey exitStatusKey = ExitDiagnostics.extractExitStatusKey(fullDiagnostics);
stop(new StopStatus(exitStatusKey.toInt(), true, fullDiagnostics));
}
use of com.microsoft.frameworklauncher.common.exit.ExitStatusKey in project pai by Microsoft.
the class Service method retrieveApplicationExitCode.
// retrieveApplicationExitCode to prepare completeApplication
private void retrieveApplicationExitCode(String applicationId, String diagnostics) throws Exception {
String logSuffix = String.format("[%s]: retrieveApplicationExitCode: ExitDiagnostics: %s", applicationId, diagnostics);
if (!statusManager.isApplicationIdAssociated(applicationId)) {
LOGGER.logWarning("[NotAssociated]%s", logSuffix);
return;
}
FrameworkStatus frameworkStatus = statusManager.getFrameworkStatusWithAssociatedApplicationId(applicationId);
FrameworkState frameworkState = frameworkStatus.getFrameworkState();
String frameworkName = frameworkStatus.getFrameworkName();
Integer exitCode = frameworkStatus.getApplicationExitCode();
if (frameworkState != FrameworkState.APPLICATION_RETRIEVING_DIAGNOSTICS) {
LOGGER.logWarning("[%s]%s. Current FrameworkState %s is not %s. Ignore it.", frameworkName, logSuffix, frameworkState, FrameworkState.APPLICATION_RETRIEVING_DIAGNOSTICS);
return;
}
// RetrieveExitCode
LOGGER.logDebug("[%s]%s", frameworkName, logSuffix);
if (exitCode == null) {
ExitStatusKey exitStatusKey = ExitDiagnostics.extractExitStatusKey(diagnostics);
exitCode = ExitDiagnostics.lookupExitCode(exitStatusKey);
}
completeApplication(frameworkStatus, exitCode, diagnostics);
}
Aggregations