YARN-2617. Fixed ApplicationSubmissionContext to still set resource for backward compatibility. Contributed by Wangda Tan.

This commit is contained in:
Zhijie Shen 2014-10-09 17:57:50 -07:00
parent 4f426fe223
commit e532ed8faa
3 changed files with 11 additions and 0 deletions

View File

@ -611,6 +611,9 @@ Release 2.6.0 - UNRELEASED
YARN-2598 GHS should show N/A instead of null for the inaccessible information
(Zhijie Shen via mayank)
YARN-2617. Fixed ApplicationSubmissionContext to still set resource for
backward compatibility. (Wangda Tan via zjshen)
Release 2.5.1 - 2014-09-05
INCOMPATIBLE CHANGES

View File

@ -89,6 +89,7 @@ public static ApplicationSubmissionContext newInstance(
context.setApplicationType(applicationType);
context.setKeepContainersAcrossApplicationAttempts(keepContainers);
context.setNodeLabelExpression(appLabelExpression);
context.setResource(resource);
ResourceRequest amReq = Records.newRecord(ResourceRequest.class);
amReq.setResourceName(ResourceRequest.ANY);

View File

@ -45,6 +45,7 @@
import org.apache.hadoop.yarn.proto.YarnProtos.*;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.*;
import org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.*;
import org.apache.hadoop.yarn.util.resource.Resources;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
@ -654,6 +655,12 @@ public void testApplicationResourceUsageReportPBImpl() throws Exception {
public void testApplicationSubmissionContextPBImpl() throws Exception {
validatePBImplRecord(ApplicationSubmissionContextPBImpl.class,
ApplicationSubmissionContextProto.class);
ApplicationSubmissionContext ctx =
ApplicationSubmissionContext.newInstance(null, null, null, null, null,
false, false, 0, Resources.none(), null, false, null, null);
Assert.assertNotNull(ctx.getResource());
}
@Test