Search in sources :

Example 1 with ExitStatusKey

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));
}
Also used : StopStatus(com.microsoft.frameworklauncher.common.service.StopStatus) ExitStatusKey(com.microsoft.frameworklauncher.common.exit.ExitStatusKey) ExitStatusValue(com.microsoft.frameworklauncher.common.exit.ExitStatusValue)

Example 2 with ExitStatusKey

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);
}
Also used : ExitStatusKey(com.microsoft.frameworklauncher.common.exit.ExitStatusKey)

Aggregations

ExitStatusKey (com.microsoft.frameworklauncher.common.exit.ExitStatusKey)2 ExitStatusValue (com.microsoft.frameworklauncher.common.exit.ExitStatusValue)1 StopStatus (com.microsoft.frameworklauncher.common.service.StopStatus)1