YARN-2355. MAX_APP_ATTEMPTS_ENV may no longer be a useful env var for a container (Darrell Taylor via aw)

This commit is contained in:
Allen Wittenauer 2015-05-27 16:40:56 -07:00
parent 4d8fb8c19c
commit d6e3164d4a
4 changed files with 41 additions and 48 deletions

View File

@ -48,6 +48,9 @@ Trunk - Unreleased
YARN-2428. LCE default banned user list should have yarn (Varun
Saxena via aw)
YARN-2355. MAX_APP_ATTEMPTS_ENV may no longer be a useful env var
for a container (Darrell Taylor via aw)
Release 2.8.0 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -98,12 +98,6 @@ public interface ApplicationConstants {
public static final String STDOUT = "stdout";
/**
* The environment variable for MAX_APP_ATTEMPTS. Set in AppMaster environment
* only
*/
public static final String MAX_APP_ATTEMPTS_ENV = "MAX_APP_ATTEMPTS";
/**
* Environment for Applications.
*

View File

@ -209,7 +209,7 @@ protected void setupTokens(
Map<String, String> environment = container.getEnvironment();
environment.put(ApplicationConstants.APPLICATION_WEB_PROXY_BASE_ENV,
application.getWebProxyBase());
// Set AppSubmitTime and MaxAppAttempts to be consumable by the AM.
// Set AppSubmitTime to be consumable by the AM.
ApplicationId applicationId =
application.getAppAttemptId().getApplicationId();
environment.put(
@ -217,9 +217,6 @@ protected void setupTokens(
String.valueOf(rmContext.getRMApps()
.get(applicationId)
.getSubmitTime()));
environment.put(ApplicationConstants.MAX_APP_ATTEMPTS_ENV,
String.valueOf(rmContext.getRMApps().get(
applicationId).getMaxAppAttempts()));
Credentials credentials = new Credentials();
DataInputByteBuffer dibb = new DataInputByteBuffer();

View File

@ -107,8 +107,7 @@ private static final class MyContainerManagerImpl implements
nmHostAtContainerManager = tokenId.getNmHostAddress();
submitTimeAtContainerManager =
Long.parseLong(env.get(ApplicationConstants.APP_SUBMIT_TIME_ENV));
maxAppAttempts =
Integer.parseInt(env.get(ApplicationConstants.MAX_APP_ATTEMPTS_ENV));
maxAppAttempts = YarnConfiguration.DEFAULT_RM_AM_MAX_ATTEMPTS;
return StartContainersResponse.newInstance(
new HashMap<String, ByteBuffer>(), new ArrayList<ContainerId>(),
new HashMap<ContainerId, SerializedException>());