YARN-2766. Made ApplicationHistoryManager return a sorted list of apps, attempts and containers. Contributed by Robert Kanter.
This commit is contained in:
parent
4ae9780e6a
commit
3648cb57c9
|
@ -81,6 +81,9 @@ Release 2.7.0 - UNRELEASED
|
||||||
YARN-2713. "RM Home" link in NM should point to one of the RMs in an
|
YARN-2713. "RM Home" link in NM should point to one of the RMs in an
|
||||||
HA setup. (kasha)
|
HA setup. (kasha)
|
||||||
|
|
||||||
|
YARN-2766. Made ApplicationHistoryManager return a sorted list of apps,
|
||||||
|
attempts and containers. (Robert Kanter via zjshen)
|
||||||
|
|
||||||
Release 2.6.0 - 2014-11-18
|
Release 2.6.0 - 2014-11-18
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.server.applicationhistoryservice;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -102,7 +103,7 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
|
||||||
null, null, Long.MAX_VALUE, EnumSet.allOf(Field.class),
|
null, null, Long.MAX_VALUE, EnumSet.allOf(Field.class),
|
||||||
UserGroupInformation.getLoginUser());
|
UserGroupInformation.getLoginUser());
|
||||||
Map<ApplicationId, ApplicationReport> apps =
|
Map<ApplicationId, ApplicationReport> apps =
|
||||||
new HashMap<ApplicationId, ApplicationReport>();
|
new LinkedHashMap<ApplicationId, ApplicationReport>();
|
||||||
if (entities != null && entities.getEntities() != null) {
|
if (entities != null && entities.getEntities() != null) {
|
||||||
for (TimelineEntity entity : entities.getEntities()) {
|
for (TimelineEntity entity : entities.getEntities()) {
|
||||||
ApplicationReportExt app =
|
ApplicationReportExt app =
|
||||||
|
@ -128,7 +129,7 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
|
||||||
Long.MAX_VALUE, EnumSet.allOf(Field.class),
|
Long.MAX_VALUE, EnumSet.allOf(Field.class),
|
||||||
UserGroupInformation.getLoginUser());
|
UserGroupInformation.getLoginUser());
|
||||||
Map<ApplicationAttemptId, ApplicationAttemptReport> appAttempts =
|
Map<ApplicationAttemptId, ApplicationAttemptReport> appAttempts =
|
||||||
new HashMap<ApplicationAttemptId, ApplicationAttemptReport>();
|
new LinkedHashMap<ApplicationAttemptId, ApplicationAttemptReport>();
|
||||||
for (TimelineEntity entity : entities.getEntities()) {
|
for (TimelineEntity entity : entities.getEntities()) {
|
||||||
ApplicationAttemptReport appAttempt =
|
ApplicationAttemptReport appAttempt =
|
||||||
convertToApplicationAttemptReport(entity);
|
convertToApplicationAttemptReport(entity);
|
||||||
|
@ -198,7 +199,7 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService
|
||||||
null, null, Long.MAX_VALUE, EnumSet.allOf(Field.class),
|
null, null, Long.MAX_VALUE, EnumSet.allOf(Field.class),
|
||||||
UserGroupInformation.getLoginUser());
|
UserGroupInformation.getLoginUser());
|
||||||
Map<ContainerId, ContainerReport> containers =
|
Map<ContainerId, ContainerReport> containers =
|
||||||
new HashMap<ContainerId, ContainerReport>();
|
new LinkedHashMap<ContainerId, ContainerReport>();
|
||||||
if (entities != null && entities.getEntities() != null) {
|
if (entities != null && entities.getEntities() != null) {
|
||||||
for (TimelineEntity entity : entities.getEntities()) {
|
for (TimelineEntity entity : entities.getEntities()) {
|
||||||
ContainerReport container = convertToContainerReport(
|
ContainerReport container = convertToContainerReport(
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class TestApplicationHistoryClientService {
|
||||||
clientService.getClientHandler().getContainers(request);
|
clientService.getClientHandler().getContainers(request);
|
||||||
List<ContainerReport> containers = response.getContainerList();
|
List<ContainerReport> containers = response.getContainerList();
|
||||||
Assert.assertNotNull(containers);
|
Assert.assertNotNull(containers);
|
||||||
Assert.assertEquals(containerId, containers.get(1).getContainerId());
|
Assert.assertEquals(containerId, containers.get(0).getContainerId());
|
||||||
Assert.assertEquals(containerId1, containers.get(0).getContainerId());
|
Assert.assertEquals(containerId1, containers.get(1).getContainerId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue