YARN-8205. Application State is not updated to ATS if AM launching is delayed. Contributed by Rohith Sharma K S.

This commit is contained in:
Sunil G 2018-04-27 10:26:57 +05:30
parent 7d8bcf534a
commit 1634de0fc1
4 changed files with 6 additions and 0 deletions

View File

@ -108,6 +108,8 @@ public class TimelineServiceV1Publisher extends AbstractSystemMetricsPublisher {
app.getApplicationSubmissionContext().getAMContainerSpec(); app.getApplicationSubmissionContext().getAMContainerSpec();
entityInfo.put(ApplicationMetricsConstants.AM_CONTAINER_LAUNCH_COMMAND, entityInfo.put(ApplicationMetricsConstants.AM_CONTAINER_LAUNCH_COMMAND,
amContainerSpec.getCommands()); amContainerSpec.getCommands());
entityInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO,
RMServerUtils.createApplicationState(app.getState()).toString());
entity.setOtherInfo(entityInfo); entity.setOtherInfo(entityInfo);
TimelineEvent tEvent = new TimelineEvent(); TimelineEvent tEvent = new TimelineEvent();

View File

@ -139,6 +139,8 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
app.getApplicationSubmissionContext().getAMContainerSpec(); app.getApplicationSubmissionContext().getAMContainerSpec();
entityInfo.put(ApplicationMetricsConstants.AM_CONTAINER_LAUNCH_COMMAND, entityInfo.put(ApplicationMetricsConstants.AM_CONTAINER_LAUNCH_COMMAND,
amContainerSpec.getCommands()); amContainerSpec.getCommands());
entityInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO,
RMServerUtils.createApplicationState(app.getState()).toString());
entity.setInfo(entityInfo); entity.setInfo(entityInfo);
TimelineEvent tEvent = new TimelineEvent(); TimelineEvent tEvent = new TimelineEvent();

View File

@ -541,6 +541,7 @@ public class TestSystemMetricsPublisher {
when(app.getApplicationPriority()).thenReturn(Priority.newInstance(10)); when(app.getApplicationPriority()).thenReturn(Priority.newInstance(10));
when(app.getCallerContext()) when(app.getCallerContext())
.thenReturn(new CallerContext.Builder("context").build()); .thenReturn(new CallerContext.Builder("context").build());
when(app.getState()).thenReturn(RMAppState.SUBMITTED);
return app; return app;
} }

View File

@ -389,6 +389,7 @@ public class TestSystemMetricsPublisherForV2 {
when(app.getApplicationSubmissionContext()) when(app.getApplicationSubmissionContext())
.thenReturn(appSubmissionContext); .thenReturn(appSubmissionContext);
when(app.getState()).thenReturn(RMAppState.SUBMITTED);
return app; return app;
} }