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

(cherry picked from commit e532ed8faa)
This commit is contained in:
Zhijie Shen 2014-10-09 17:57:50 -07:00
parent 14080ea3d2
commit 647874206c
3 changed files with 11 additions and 0 deletions

View File

@ -548,6 +548,9 @@ Release 2.6.0 - UNRELEASED
YARN-2598 GHS should show N/A instead of null for the inaccessible information YARN-2598 GHS should show N/A instead of null for the inaccessible information
(Zhijie Shen via mayank) (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 Release 2.5.1 - 2014-09-05
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

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

View File

@ -45,6 +45,7 @@ import org.apache.hadoop.yarn.proto.YarnServerResourceManagerServiceProtos.*;
import org.apache.hadoop.yarn.proto.YarnProtos.*; import org.apache.hadoop.yarn.proto.YarnProtos.*;
import org.apache.hadoop.yarn.proto.YarnServiceProtos.*; import org.apache.hadoop.yarn.proto.YarnServiceProtos.*;
import org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.*; 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.Assert;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Ignore; import org.junit.Ignore;
@ -654,6 +655,12 @@ public class TestPBImplRecords {
public void testApplicationSubmissionContextPBImpl() throws Exception { public void testApplicationSubmissionContextPBImpl() throws Exception {
validatePBImplRecord(ApplicationSubmissionContextPBImpl.class, validatePBImplRecord(ApplicationSubmissionContextPBImpl.class,
ApplicationSubmissionContextProto.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 @Test