YARN-2066. Wrong field is referenced in GetApplicationsRequestPBImpl#mergeLocalToBuilder (Contributed by Hong Zhiguo)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1595413 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Junping Du 2014-05-17 01:43:15 +00:00
parent 7bff84ad19
commit 461ded8bd4
3 changed files with 13 additions and 8 deletions

View File

@ -231,6 +231,9 @@ Release 2.4.1 - UNRELEASED
YARN-2053. Fixed a bug in AMS to not add null NMToken into NMTokens list from YARN-2053. Fixed a bug in AMS to not add null NMToken into NMTokens list from
previous attempts for work-preserving AM restart. (Wangda Tan via jianhe) previous attempts for work-preserving AM restart. (Wangda Tan via jianhe)
YARN-2066. Wrong field is referenced in GetApplicationsRequestPBImpl#mergeLocalToBuilder()
(Hong Zhiguo via junping_du)
Release 2.4.0 - 2014-04-07 Release 2.4.0 - 2014-04-07
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -127,8 +127,8 @@ public class GetApplicationsRequestPBImpl extends GetApplicationsRequest {
} }
if (this.finish != null) { if (this.finish != null) {
builder.setFinishBegin(start.getMinimumLong()); builder.setFinishBegin(finish.getMinimumLong());
builder.setFinishEnd(start.getMaximumLong()); builder.setFinishEnd(finish.getMaximumLong());
} }
builder.setLimit(limit); builder.setLimit(limit);

View File

@ -47,10 +47,12 @@ public class TestGetApplicationsRequest {
types.add("type1"); types.add("type1");
request.setApplicationTypes(types); request.setApplicationTypes(types);
long begin = System.currentTimeMillis(); long startBegin = System.currentTimeMillis();
long end = System.currentTimeMillis() + 1; long startEnd = System.currentTimeMillis() + 1;
request.setStartRange(begin, end); request.setStartRange(startBegin, startEnd);
request.setFinishRange(begin, end); long finishBegin = System.currentTimeMillis() + 2;
long finishEnd = System.currentTimeMillis() + 3;
request.setFinishRange(finishBegin, finishEnd);
long limit = 100L; long limit = 100L;
request.setLimit(limit); request.setLimit(limit);
@ -85,11 +87,11 @@ public class TestGetApplicationsRequest {
Assert.assertEquals( Assert.assertEquals(
"StartRange from proto is not the same with original request", "StartRange from proto is not the same with original request",
requestFromProto.getStartRange(), new LongRange(begin, end)); requestFromProto.getStartRange(), new LongRange(startBegin, startEnd));
Assert.assertEquals( Assert.assertEquals(
"FinishRange from proto is not the same with original request", "FinishRange from proto is not the same with original request",
requestFromProto.getFinishRange(), new LongRange(begin, end)); requestFromProto.getFinishRange(), new LongRange(finishBegin, finishEnd));
Assert.assertEquals( Assert.assertEquals(
"Limit from proto is not the same with original request", "Limit from proto is not the same with original request",