|
@@ -157,22 +157,22 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
|
|
|
TimelineEvent tEvent = new TimelineEvent();
|
|
|
tEvent.setId(ApplicationMetricsConstants.FINISHED_EVENT_TYPE);
|
|
|
tEvent.setTimestamp(finishedTime);
|
|
|
- Map<String, Object> eventInfo = new HashMap<String, Object>();
|
|
|
- eventInfo.put(ApplicationMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
|
|
|
+ entity.addEvent(tEvent);
|
|
|
+
|
|
|
+ Map<String, Object> entityInfo = new HashMap<String, Object>();
|
|
|
+ entityInfo.put(ApplicationMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
|
|
|
app.getDiagnostics().toString());
|
|
|
- eventInfo.put(ApplicationMetricsConstants.FINAL_STATUS_EVENT_INFO,
|
|
|
+ entityInfo.put(ApplicationMetricsConstants.FINAL_STATUS_EVENT_INFO,
|
|
|
app.getFinalApplicationStatus().toString());
|
|
|
- eventInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO,
|
|
|
+ entityInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO,
|
|
|
RMServerUtils.createApplicationState(state).toString());
|
|
|
ApplicationAttemptId appAttemptId = app.getCurrentAppAttempt() == null
|
|
|
? null : app.getCurrentAppAttempt().getAppAttemptId();
|
|
|
if (appAttemptId != null) {
|
|
|
- eventInfo.put(ApplicationMetricsConstants.LATEST_APP_ATTEMPT_EVENT_INFO,
|
|
|
+ entityInfo.put(ApplicationMetricsConstants.LATEST_APP_ATTEMPT_EVENT_INFO,
|
|
|
appAttemptId.toString());
|
|
|
}
|
|
|
- tEvent.setInfo(eventInfo);
|
|
|
-
|
|
|
- entity.addEvent(tEvent);
|
|
|
+ entity.setInfo(entityInfo);
|
|
|
|
|
|
getDispatcher().getEventHandler().handle(new TimelineV2PublishEvent(
|
|
|
SystemMetricsEventType.PUBLISH_ENTITY, entity, app.getApplicationId()));
|
|
@@ -193,6 +193,11 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
|
|
|
tEvent.setInfo(eventInfo);
|
|
|
entity.addEvent(tEvent);
|
|
|
|
|
|
+ // publish in entity info also to query using filters
|
|
|
+ Map<String, Object> entityInfo = new HashMap<String, Object>();
|
|
|
+ entityInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO, appState);
|
|
|
+ entity.setInfo(entityInfo);
|
|
|
+
|
|
|
getDispatcher().getEventHandler().handle(new TimelineV2PublishEvent(
|
|
|
SystemMetricsEventType.PUBLISH_ENTITY, entity, app.getApplicationId()));
|
|
|
}
|
|
@@ -250,21 +255,23 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
|
|
|
TimelineEvent tEvent = new TimelineEvent();
|
|
|
tEvent.setId(AppAttemptMetricsConstants.REGISTERED_EVENT_TYPE);
|
|
|
tEvent.setTimestamp(registeredTime);
|
|
|
- Map<String, Object> eventInfo = new HashMap<String, Object>();
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.TRACKING_URL_EVENT_INFO,
|
|
|
+ entity.addEvent(tEvent);
|
|
|
+
|
|
|
+ Map<String, Object> entityInfo = new HashMap<String, Object>();
|
|
|
+ entityInfo.put(AppAttemptMetricsConstants.TRACKING_URL_INFO,
|
|
|
appAttempt.getTrackingUrl());
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.ORIGINAL_TRACKING_URL_EVENT_INFO,
|
|
|
+ entityInfo.put(AppAttemptMetricsConstants.ORIGINAL_TRACKING_URL_INFO,
|
|
|
appAttempt.getOriginalTrackingUrl());
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.HOST_EVENT_INFO,
|
|
|
+ entityInfo.put(AppAttemptMetricsConstants.HOST_INFO,
|
|
|
appAttempt.getHost());
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.RPC_PORT_EVENT_INFO,
|
|
|
+ entityInfo.put(AppAttemptMetricsConstants.RPC_PORT_INFO,
|
|
|
appAttempt.getRpcPort());
|
|
|
if (appAttempt.getMasterContainer() != null) {
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO,
|
|
|
+ entityInfo.put(AppAttemptMetricsConstants.MASTER_CONTAINER_INFO,
|
|
|
appAttempt.getMasterContainer().getId().toString());
|
|
|
}
|
|
|
- tEvent.setInfo(eventInfo);
|
|
|
- entity.addEvent(tEvent);
|
|
|
+ entity.setInfo(entityInfo);
|
|
|
+
|
|
|
getDispatcher().getEventHandler().handle(
|
|
|
new TimelineV2PublishEvent(SystemMetricsEventType.PUBLISH_ENTITY,
|
|
|
entity, appAttempt.getAppAttemptId().getApplicationId()));
|
|
@@ -281,26 +288,20 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
|
|
|
TimelineEvent tEvent = new TimelineEvent();
|
|
|
tEvent.setId(AppAttemptMetricsConstants.FINISHED_EVENT_TYPE);
|
|
|
tEvent.setTimestamp(finishedTime);
|
|
|
- Map<String, Object> eventInfo = new HashMap<String, Object>();
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.TRACKING_URL_EVENT_INFO,
|
|
|
- appAttempt.getTrackingUrl());
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.ORIGINAL_TRACKING_URL_EVENT_INFO,
|
|
|
- appAttempt.getOriginalTrackingUrl());
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
|
|
|
+ entity.addEvent(tEvent);
|
|
|
+
|
|
|
+ Map<String, Object> entityInfo = new HashMap<String, Object>();
|
|
|
+ entityInfo.put(AppAttemptMetricsConstants.DIAGNOSTICS_INFO,
|
|
|
appAttempt.getDiagnostics());
|
|
|
// app will get the final status from app attempt, or create one
|
|
|
// based on app state if it doesn't exist
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.FINAL_STATUS_EVENT_INFO,
|
|
|
+ entityInfo.put(AppAttemptMetricsConstants.FINAL_STATUS_INFO,
|
|
|
app.getFinalApplicationStatus().toString());
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.STATE_EVENT_INFO, RMServerUtils
|
|
|
+ entityInfo.put(AppAttemptMetricsConstants.STATE_INFO, RMServerUtils
|
|
|
.createApplicationAttemptState(appAttemtpState).toString());
|
|
|
- if (appAttempt.getMasterContainer() != null) {
|
|
|
- eventInfo.put(AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO,
|
|
|
- appAttempt.getMasterContainer().getId().toString());
|
|
|
- }
|
|
|
- tEvent.setInfo(eventInfo);
|
|
|
+ entity.setInfo(entityInfo);
|
|
|
+
|
|
|
|
|
|
- entity.addEvent(tEvent);
|
|
|
getDispatcher().getEventHandler().handle(
|
|
|
new TimelineV2PublishEvent(SystemMetricsEventType.PUBLISH_ENTITY,
|
|
|
entity, appAttempt.getAppAttemptId().getApplicationId()));
|
|
@@ -325,25 +326,26 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
|
|
|
TimelineEvent tEvent = new TimelineEvent();
|
|
|
tEvent.setId(ContainerMetricsConstants.CREATED_IN_RM_EVENT_TYPE);
|
|
|
tEvent.setTimestamp(createdTime);
|
|
|
+ entity.addEvent(tEvent);
|
|
|
+
|
|
|
// updated as event info instead of entity info, as entity info is updated
|
|
|
// by NM
|
|
|
- Map<String, Object> eventInfo = new HashMap<String, Object>();
|
|
|
- eventInfo.put(ContainerMetricsConstants.ALLOCATED_MEMORY_ENTITY_INFO,
|
|
|
+ Map<String, Object> entityInfo = new HashMap<String, Object>();
|
|
|
+ entityInfo.put(ContainerMetricsConstants.ALLOCATED_MEMORY_INFO,
|
|
|
container.getAllocatedResource().getMemorySize());
|
|
|
- eventInfo.put(ContainerMetricsConstants.ALLOCATED_VCORE_ENTITY_INFO,
|
|
|
+ entityInfo.put(ContainerMetricsConstants.ALLOCATED_VCORE_INFO,
|
|
|
container.getAllocatedResource().getVirtualCores());
|
|
|
- eventInfo.put(ContainerMetricsConstants.ALLOCATED_HOST_ENTITY_INFO,
|
|
|
+ entityInfo.put(ContainerMetricsConstants.ALLOCATED_HOST_INFO,
|
|
|
container.getAllocatedNode().getHost());
|
|
|
- eventInfo.put(ContainerMetricsConstants.ALLOCATED_PORT_ENTITY_INFO,
|
|
|
+ entityInfo.put(ContainerMetricsConstants.ALLOCATED_PORT_INFO,
|
|
|
container.getAllocatedNode().getPort());
|
|
|
- eventInfo.put(ContainerMetricsConstants.ALLOCATED_PRIORITY_ENTITY_INFO,
|
|
|
+ entityInfo.put(ContainerMetricsConstants.ALLOCATED_PRIORITY_INFO,
|
|
|
container.getAllocatedPriority().getPriority());
|
|
|
- eventInfo.put(
|
|
|
- ContainerMetricsConstants.ALLOCATED_HOST_HTTP_ADDRESS_ENTITY_INFO,
|
|
|
+ entityInfo.put(
|
|
|
+ ContainerMetricsConstants.ALLOCATED_HOST_HTTP_ADDRESS_INFO,
|
|
|
container.getNodeHttpAddress());
|
|
|
- tEvent.setInfo(eventInfo);
|
|
|
+ entity.setInfo(entityInfo);
|
|
|
|
|
|
- entity.addEvent(tEvent);
|
|
|
getDispatcher().getEventHandler().handle(new TimelineV2PublishEvent(
|
|
|
SystemMetricsEventType.PUBLISH_ENTITY, entity, container
|
|
|
.getContainerId().getApplicationAttemptId().getApplicationId()));
|
|
@@ -359,22 +361,19 @@ public class TimelineServiceV2Publisher extends AbstractSystemMetricsPublisher {
|
|
|
TimelineEvent tEvent = new TimelineEvent();
|
|
|
tEvent.setId(ContainerMetricsConstants.FINISHED_IN_RM_EVENT_TYPE);
|
|
|
tEvent.setTimestamp(finishedTime);
|
|
|
- Map<String, Object> eventInfo = new HashMap<String, Object>();
|
|
|
- eventInfo.put(ContainerMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
|
|
|
+ entity.addEvent(tEvent);
|
|
|
+
|
|
|
+ Map<String, Object> entityInfo = new HashMap<String, Object>();
|
|
|
+ entityInfo.put(ContainerMetricsConstants.DIAGNOSTICS_INFO,
|
|
|
container.getDiagnosticsInfo());
|
|
|
- eventInfo.put(ContainerMetricsConstants.EXIT_STATUS_EVENT_INFO,
|
|
|
+ entityInfo.put(ContainerMetricsConstants.EXIT_STATUS_INFO,
|
|
|
container.getContainerExitStatus());
|
|
|
- eventInfo.put(ContainerMetricsConstants.STATE_EVENT_INFO,
|
|
|
+ entityInfo.put(ContainerMetricsConstants.STATE_INFO,
|
|
|
container.getContainerState().toString());
|
|
|
- Map<String, Object> entityInfo = new HashMap<String, Object>();
|
|
|
- entityInfo.put(ContainerMetricsConstants.ALLOCATED_HOST_ENTITY_INFO,
|
|
|
- container.getAllocatedNode().getHost());
|
|
|
- entityInfo.put(ContainerMetricsConstants.ALLOCATED_PORT_ENTITY_INFO,
|
|
|
- container.getAllocatedNode().getPort());
|
|
|
+ entityInfo.put(ContainerMetricsConstants.CONTAINER_FINISHED_TIME,
|
|
|
+ finishedTime);
|
|
|
entity.setInfo(entityInfo);
|
|
|
- tEvent.setInfo(eventInfo);
|
|
|
|
|
|
- entity.addEvent(tEvent);
|
|
|
getDispatcher().getEventHandler().handle(new TimelineV2PublishEvent(
|
|
|
SystemMetricsEventType.PUBLISH_ENTITY, entity, container
|
|
|
.getContainerId().getApplicationAttemptId().getApplicationId()));
|