appContext.setMaxAppAttempts( configuration.getInteger( YarnConfigOptions.APPLICATION_ATTEMPTS.key(), } else { appContext.setMaxAppAttempts( configuration.getInteger( YarnConfigOptions.APPLICATION_ATTEMPTS.key(),
appContext.setMaxAppAttempts(1);
private ApplicationReport startAppMaster(ApplicationSubmissionContext appContext) throws Exception { appContext.setMaxAppAttempts(MAX_ATTEMPT);
/** * Sets the maximum application attempts for the application. * @param maxApplicationAttempts * @return */ public YarnSubmissionHelper setMaxApplicationAttempts(final int maxApplicationAttempts) { applicationSubmissionContext.setMaxAppAttempts(maxApplicationAttempts); return this; }
/** * Updates the {@link ApplicationSubmissionContext} based on configuration. */ protected void configureAppSubmissionContext(ApplicationSubmissionContext context) { int maxAttempts = configuration.getInt(Configs.Keys.YARN_MAX_APP_ATTEMPTS, -1); if (maxAttempts > 0) { context.setMaxAppAttempts(maxAttempts); } else { // Preserve the old behavior context.setMaxAppAttempts(2); } }
/** * Updates the {@link ApplicationSubmissionContext} based on configuration. */ protected void configureAppSubmissionContext(ApplicationSubmissionContext context) { int maxAttempts = configuration.getInt(Configs.Keys.YARN_MAX_APP_ATTEMPTS, -1); if (maxAttempts > 0) { context.setMaxAppAttempts(maxAttempts); } else { // Preserve the old behavior context.setMaxAppAttempts(2); } }
@Override protected ApplicationSubmissionContext getSubmissionContext(ApplicationId applicationId) { ApplicationSubmissionContext submissionContext = super.getSubmissionContext(applicationId); // force app fail after first appmaster failure regardles // what's set on yarn level. // TODO: should make configurable in spring yarn if possible submissionContext.setMaxAppAttempts(1); return submissionContext; } }
private void setMaxAttempts(Configuration launcherJobConf, ApplicationSubmissionContext appContext) { int launcherMaxAttempts; final int defaultLauncherMaxAttempts = ConfigurationService.getInt(DEFAULT_LAUNCHER_MAX_ATTEMPTS); if (launcherJobConf.get(LauncherAM.OOZIE_LAUNCHER_MAX_ATTEMPTS) != null) { try { launcherMaxAttempts = launcherJobConf.getInt(LauncherAM.OOZIE_LAUNCHER_MAX_ATTEMPTS, defaultLauncherMaxAttempts); } catch (final NumberFormatException ignored) { launcherMaxAttempts = defaultLauncherMaxAttempts; } } else { LOG.warn("Invalid configuration value [{0}] defined for launcher max attempts count, using default [{1}].", launcherJobConf.get(LauncherAM.OOZIE_LAUNCHER_MAX_ATTEMPTS), defaultLauncherMaxAttempts); launcherMaxAttempts = defaultLauncherMaxAttempts; } LOG.trace("Reading from configuration max attempts count of the Launcher AM. [launcherMaxAttempts={0}]", launcherMaxAttempts); if (launcherMaxAttempts > 0) { LOG.trace("Setting max attempts of the Launcher AM. [launcherMaxAttempts={0}]", launcherMaxAttempts); appContext.setMaxAppAttempts(launcherMaxAttempts); } else { LOG.warn("Not setting max attempts of the Launcher AM, value is invalid. [launcherMaxAttempts={0}]", launcherMaxAttempts); } }
private void setMaxAttempts(Configuration launcherJobConf, ApplicationSubmissionContext appContext) { int launcherMaxAttempts; final int defaultLauncherMaxAttempts = ConfigurationService.getInt(DEFAULT_LAUNCHER_MAX_ATTEMPTS); if (launcherJobConf.get(LauncherAM.OOZIE_LAUNCHER_MAX_ATTEMPTS) != null) { try { launcherMaxAttempts = launcherJobConf.getInt(LauncherAM.OOZIE_LAUNCHER_MAX_ATTEMPTS, defaultLauncherMaxAttempts); } catch (final NumberFormatException ignored) { launcherMaxAttempts = defaultLauncherMaxAttempts; } } else { LOG.warn("Invalid configuration value [{0}] defined for launcher max attempts count, using default [{1}].", launcherJobConf.get(LauncherAM.OOZIE_LAUNCHER_MAX_ATTEMPTS), defaultLauncherMaxAttempts); launcherMaxAttempts = defaultLauncherMaxAttempts; } LOG.trace("Reading from configuration max attempts count of the Launcher AM. [launcherMaxAttempts={0}]", launcherMaxAttempts); if (launcherMaxAttempts > 0) { LOG.trace("Setting max attempts of the Launcher AM. [launcherMaxAttempts={0}]", launcherMaxAttempts); appContext.setMaxAppAttempts(launcherMaxAttempts); } else { LOG.warn("Not setting max attempts of the Launcher AM, value is invalid. [launcherMaxAttempts={0}]", launcherMaxAttempts); } }
submissionContext.setMaxAppAttempts(maxAppAttempts);
@Public @Stable public static ApplicationSubmissionContext newInstance( ApplicationId applicationId, String applicationName, String queue, ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, String applicationType, boolean keepContainers, String appLabelExpression, ResourceRequest resourceRequest) { ApplicationSubmissionContext context = Records.newRecord(ApplicationSubmissionContext.class); context.setApplicationId(applicationId); context.setApplicationName(applicationName); context.setQueue(queue); context.setAMContainerSpec(amContainer); context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setApplicationType(applicationType); context.setKeepContainersAcrossApplicationAttempts(keepContainers); context.setNodeLabelExpression(appLabelExpression); context.setAMContainerResourceRequests( Collections.singletonList(resourceRequest)); return context; }
public static ApplicationSubmissionContext newApplicationSubmissionContext( ApplicationId applicationId, String applicationName, String queue, Priority priority, ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, Resource resource, String applicationType) { ApplicationSubmissionContext context = recordFactory.newRecordInstance(ApplicationSubmissionContext.class); context.setApplicationId(applicationId); context.setApplicationName(applicationName); context.setQueue(queue); context.setPriority(priority); context.setAMContainerSpec(amContainer); context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setResource(resource); context.setApplicationType(applicationType); return context; }
public static ApplicationSubmissionContext newApplicationSubmissionContext( ApplicationId applicationId, String applicationName, String queue, Priority priority, ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, Resource resource, String applicationType) { ApplicationSubmissionContext context = recordFactory.newRecordInstance(ApplicationSubmissionContext.class); context.setApplicationId(applicationId); context.setApplicationName(applicationName); context.setQueue(queue); context.setPriority(priority); context.setAMContainerSpec(amContainer); context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setResource(resource); context.setApplicationType(applicationType); return context; }
public static ApplicationSubmissionContext newApplicationSubmissionContext( ApplicationId applicationId, String applicationName, String queue, Priority priority, ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, Resource resource, String applicationType) { ApplicationSubmissionContext context = recordFactory.newRecordInstance(ApplicationSubmissionContext.class); context.setApplicationId(applicationId); context.setApplicationName(applicationName); context.setQueue(queue); context.setPriority(priority); context.setAMContainerSpec(amContainer); context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setResource(resource); context.setApplicationType(applicationType); return context; }
@Public @Stable public static ApplicationSubmissionContext newInstance( ApplicationId applicationId, String applicationName, String queue, ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, String applicationType, boolean keepContainers, String appLabelExpression, ResourceRequest resourceRequest) { ApplicationSubmissionContext context = Records.newRecord(ApplicationSubmissionContext.class); context.setApplicationId(applicationId); context.setApplicationName(applicationName); context.setQueue(queue); context.setAMContainerSpec(amContainer); context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setApplicationType(applicationType); context.setKeepContainersAcrossApplicationAttempts(keepContainers); context.setNodeLabelExpression(appLabelExpression); context.setAMContainerResourceRequest(resourceRequest); return context; }
@Public @Stable public static ApplicationSubmissionContext newInstance( ApplicationId applicationId, String applicationName, String queue, ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, String applicationType, boolean keepContainers, String appLabelExpression, ResourceRequest resourceRequest) { ApplicationSubmissionContext context = Records.newRecord(ApplicationSubmissionContext.class); context.setApplicationId(applicationId); context.setApplicationName(applicationName); context.setQueue(queue); context.setAMContainerSpec(amContainer); context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setApplicationType(applicationType); context.setKeepContainersAcrossApplicationAttempts(keepContainers); context.setNodeLabelExpression(appLabelExpression); context.setAMContainerResourceRequest(resourceRequest); return context; }
@Public @Stable public static ApplicationSubmissionContext newInstance( ApplicationId applicationId, String applicationName, String queue, ContainerLaunchContext amContainer, boolean isUnmanagedAM, boolean cancelTokensWhenComplete, int maxAppAttempts, String applicationType, boolean keepContainers, String appLabelExpression, ResourceRequest resourceRequest) { ApplicationSubmissionContext context = Records.newRecord(ApplicationSubmissionContext.class); context.setApplicationId(applicationId); context.setApplicationName(applicationName); context.setQueue(queue); context.setAMContainerSpec(amContainer); context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setApplicationType(applicationType); context.setKeepContainersAcrossApplicationAttempts(keepContainers); context.setNodeLabelExpression(appLabelExpression); context.setAMContainerResourceRequest(resourceRequest); return context; }
asContext.setApplicationId(appID); if (individualMaxAppAttempts[i][j] != 0) { asContext.setMaxAppAttempts(individualMaxAppAttempts[i][j]);
context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setApplicationType(applicationType); context.setKeepContainersAcrossApplicationAttempts(keepContainers);
context.setUnmanagedAM(isUnmanagedAM); context.setCancelTokensWhenComplete(cancelTokensWhenComplete); context.setMaxAppAttempts(maxAppAttempts); context.setApplicationType(applicationType); context.setKeepContainersAcrossApplicationAttempts(keepContainers);