diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java index 412d573dbd2..a8bf6bd421d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV2Publisher.java @@ -179,8 +179,9 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher { getTimelinelineAppMetrics(appMetrics, finishedTime); entity.setMetrics(entityMetrics); - getDispatcher().getEventHandler().handle(new TimelineV2PublishEvent( - SystemMetricsEventType.PUBLISH_ENTITY, entity, app.getApplicationId())); + getDispatcher().getEventHandler().handle( + new ApplicationFinishPublishEvent(SystemMetricsEventType. + PUBLISH_APPLICATION_FINISHED_ENTITY, entity, app)); } private Set getTimelinelineAppMetrics( @@ -452,16 +453,16 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher { } private class ApplicationFinishPublishEvent extends TimelineV2PublishEvent { - private RMAppImpl app; + private RMApp app; public ApplicationFinishPublishEvent(SystemMetricsEventType type, - TimelineEntity entity, RMAppImpl app) { + TimelineEntity entity, RMApp app) { super(type, entity, app.getApplicationId()); this.app = app; } public RMAppImpl getRMAppImpl() { - return app; + return (RMAppImpl) app; } }