YARN-5094. some YARN container events have timestamp of -1.

(cherry picked from commit 4aca4ff759f773135f8a27dbaa9731196fac5233)
(cherry picked from commit 8793e45f53607315bf6c99902452ba6cf2e3eb72)
(cherry picked from commit 895a0391fe4d7dc2b19bea6cc0528b7fd607f643)
This commit is contained in:
Haibo Chen 2018-01-19 10:27:02 -08:00
parent 8702882b54
commit c4ba8eb003
4 changed files with 7 additions and 5 deletions
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src
main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager
test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application

@ -27,7 +27,7 @@ public class ApplicationEvent extends AbstractEvent<ApplicationEventType> {
public ApplicationEvent(ApplicationId appID, public ApplicationEvent(ApplicationId appID,
ApplicationEventType appEventType) { ApplicationEventType appEventType) {
super(appEventType); super(appEventType, System.currentTimeMillis());
this.applicationID = appID; this.applicationID = appID;
} }

@ -27,7 +27,7 @@ public class ContainerEvent extends AbstractEvent<ContainerEventType> {
private final ContainerId containerID; private final ContainerId containerID;
public ContainerEvent(ContainerId cID, ContainerEventType eventType) { public ContainerEvent(ContainerId cID, ContainerEventType eventType) {
super(eventType); super(eventType, System.currentTimeMillis());
this.containerID = cID; this.containerID = cID;
} }

@ -27,7 +27,7 @@
public class LocalizationEvent extends AbstractEvent<LocalizationEventType> { public class LocalizationEvent extends AbstractEvent<LocalizationEventType> {
public LocalizationEvent(LocalizationEventType event) { public LocalizationEvent(LocalizationEventType event) {
super(event); super(event, System.currentTimeMillis());
} }
} }

@ -262,7 +262,8 @@ public void testAppFinishedOnRunningContainers() {
verify(wa.localizerBus).handle( verify(wa.localizerBus).handle(
refEq(new ApplicationLocalizationEvent( refEq(new ApplicationLocalizationEvent(
LocalizationEventType.DESTROY_APPLICATION_RESOURCES, wa.app))); LocalizationEventType.DESTROY_APPLICATION_RESOURCES,
wa.app), "timestamp"));
verify(wa.auxBus).handle( verify(wa.auxBus).handle(
refEq(new AuxServicesEvent( refEq(new AuxServicesEvent(
@ -341,7 +342,8 @@ public void testAppFinishedOnCompletedContainers() {
verify(wa.localizerBus).handle( verify(wa.localizerBus).handle(
refEq(new ApplicationLocalizationEvent( refEq(new ApplicationLocalizationEvent(
LocalizationEventType.DESTROY_APPLICATION_RESOURCES, wa.app))); LocalizationEventType.DESTROY_APPLICATION_RESOURCES, wa.app),
"timestamp"));
wa.appResourcesCleanedup(); wa.appResourcesCleanedup();
for ( Container container : wa.containers) { for ( Container container : wa.containers) {