Java Code Examples for org.apache.hadoop.yarn.api.records.timeline.TimelineEvent#setEventInfo()

The following examples show how to use org.apache.hadoop.yarn.api.records.timeline.TimelineEvent#setEventInfo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SystemMetricsPublisher.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private void
    publishAppAttemptRegisteredEvent(AppAttemptRegisteredEvent event) {
  TimelineEntity entity =
      createAppAttemptEntity(event.getApplicationAttemptId());
  TimelineEvent tEvent = new TimelineEvent();
  tEvent.setEventType(
      AppAttemptMetricsConstants.REGISTERED_EVENT_TYPE);
  tEvent.setTimestamp(event.getTimestamp());
  Map<String, Object> eventInfo = new HashMap<String, Object>();
  eventInfo.put(
      AppAttemptMetricsConstants.TRACKING_URL_EVENT_INFO,
      event.getTrackingUrl());
  eventInfo.put(
      AppAttemptMetricsConstants.ORIGINAL_TRACKING_URL_EVENT_INFO,
      event.getOriginalTrackingURL());
  eventInfo.put(AppAttemptMetricsConstants.HOST_EVENT_INFO,
      event.getHost());
  eventInfo.put(AppAttemptMetricsConstants.RPC_PORT_EVENT_INFO,
      event.getRpcPort());
  eventInfo.put(
      AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO,
      event.getMasterContainerId().toString());
  tEvent.setEventInfo(eventInfo);
  entity.addEvent(tEvent);
  putEntity(entity);
}
 
Example 2
Source File: SystemMetricsPublisher.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private void publishAppAttemptFinishedEvent(AppAttemptFinishedEvent event) {
  TimelineEntity entity =
      createAppAttemptEntity(event.getApplicationAttemptId());
  TimelineEvent tEvent = new TimelineEvent();
  tEvent.setEventType(AppAttemptMetricsConstants.FINISHED_EVENT_TYPE);
  tEvent.setTimestamp(event.getTimestamp());
  Map<String, Object> eventInfo = new HashMap<String, Object>();
  eventInfo.put(
      AppAttemptMetricsConstants.TRACKING_URL_EVENT_INFO,
      event.getTrackingUrl());
  eventInfo.put(
      AppAttemptMetricsConstants.ORIGINAL_TRACKING_URL_EVENT_INFO,
      event.getOriginalTrackingURL());
  eventInfo.put(AppAttemptMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
      event.getDiagnosticsInfo());
  eventInfo.put(AppAttemptMetricsConstants.FINAL_STATUS_EVENT_INFO,
      event.getFinalApplicationStatus().toString());
  eventInfo.put(AppAttemptMetricsConstants.STATE_EVENT_INFO,
      event.getYarnApplicationAttemptState().toString());
  tEvent.setEventInfo(eventInfo);
  entity.addEvent(tEvent);
  putEntity(entity);
}
 
Example 3
Source File: SystemMetricsPublisher.java    From hadoop with Apache License 2.0 6 votes vote down vote up
private void publishContainerFinishedEvent(ContainerFinishedEvent event) {
  TimelineEntity entity = createContainerEntity(event.getContainerId());
  TimelineEvent tEvent = new TimelineEvent();
  tEvent.setEventType(ContainerMetricsConstants.FINISHED_EVENT_TYPE);
  tEvent.setTimestamp(event.getTimestamp());
  Map<String, Object> eventInfo = new HashMap<String, Object>();
  eventInfo.put(ContainerMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
      event.getDiagnosticsInfo());
  eventInfo.put(ContainerMetricsConstants.EXIT_STATUS_EVENT_INFO,
      event.getContainerExitStatus());
  eventInfo.put(ContainerMetricsConstants.STATE_EVENT_INFO,
      event.getContainerState().toString());
  tEvent.setEventInfo(eventInfo);
  entity.addEvent(tEvent);
  putEntity(entity);
}
 
Example 4
Source File: SystemMetricsPublisher.java    From big-c with Apache License 2.0 6 votes vote down vote up
private void
    publishAppAttemptRegisteredEvent(AppAttemptRegisteredEvent event) {
  TimelineEntity entity =
      createAppAttemptEntity(event.getApplicationAttemptId());
  TimelineEvent tEvent = new TimelineEvent();
  tEvent.setEventType(
      AppAttemptMetricsConstants.REGISTERED_EVENT_TYPE);
  tEvent.setTimestamp(event.getTimestamp());
  Map<String, Object> eventInfo = new HashMap<String, Object>();
  eventInfo.put(
      AppAttemptMetricsConstants.TRACKING_URL_EVENT_INFO,
      event.getTrackingUrl());
  eventInfo.put(
      AppAttemptMetricsConstants.ORIGINAL_TRACKING_URL_EVENT_INFO,
      event.getOriginalTrackingURL());
  eventInfo.put(AppAttemptMetricsConstants.HOST_EVENT_INFO,
      event.getHost());
  eventInfo.put(AppAttemptMetricsConstants.RPC_PORT_EVENT_INFO,
      event.getRpcPort());
  eventInfo.put(
      AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO,
      event.getMasterContainerId().toString());
  tEvent.setEventInfo(eventInfo);
  entity.addEvent(tEvent);
  putEntity(entity);
}
 
Example 5
Source File: SystemMetricsPublisher.java    From big-c with Apache License 2.0 6 votes vote down vote up
private void publishAppAttemptFinishedEvent(AppAttemptFinishedEvent event) {
  TimelineEntity entity =
      createAppAttemptEntity(event.getApplicationAttemptId());
  TimelineEvent tEvent = new TimelineEvent();
  tEvent.setEventType(AppAttemptMetricsConstants.FINISHED_EVENT_TYPE);
  tEvent.setTimestamp(event.getTimestamp());
  Map<String, Object> eventInfo = new HashMap<String, Object>();
  eventInfo.put(
      AppAttemptMetricsConstants.TRACKING_URL_EVENT_INFO,
      event.getTrackingUrl());
  eventInfo.put(
      AppAttemptMetricsConstants.ORIGINAL_TRACKING_URL_EVENT_INFO,
      event.getOriginalTrackingURL());
  eventInfo.put(AppAttemptMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
      event.getDiagnosticsInfo());
  eventInfo.put(AppAttemptMetricsConstants.FINAL_STATUS_EVENT_INFO,
      event.getFinalApplicationStatus().toString());
  eventInfo.put(AppAttemptMetricsConstants.STATE_EVENT_INFO,
      event.getYarnApplicationAttemptState().toString());
  tEvent.setEventInfo(eventInfo);
  entity.addEvent(tEvent);
  putEntity(entity);
}
 
Example 6
Source File: SystemMetricsPublisher.java    From big-c with Apache License 2.0 6 votes vote down vote up
private void publishContainerFinishedEvent(ContainerFinishedEvent event) {
  TimelineEntity entity = createContainerEntity(event.getContainerId());
  TimelineEvent tEvent = new TimelineEvent();
  tEvent.setEventType(ContainerMetricsConstants.FINISHED_EVENT_TYPE);
  tEvent.setTimestamp(event.getTimestamp());
  Map<String, Object> eventInfo = new HashMap<String, Object>();
  eventInfo.put(ContainerMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
      event.getDiagnosticsInfo());
  eventInfo.put(ContainerMetricsConstants.EXIT_STATUS_EVENT_INFO,
      event.getContainerExitStatus());
  eventInfo.put(ContainerMetricsConstants.STATE_EVENT_INFO,
      event.getContainerState().toString());
  tEvent.setEventInfo(eventInfo);
  entity.addEvent(tEvent);
  putEntity(entity);
}
 
Example 7
Source File: SystemMetricsPublisher.java    From hadoop with Apache License 2.0 5 votes vote down vote up
private void publishApplicationFinishedEvent(ApplicationFinishedEvent event) {
  TimelineEntity entity =
      createApplicationEntity(event.getApplicationId());
  TimelineEvent tEvent = new TimelineEvent();
  tEvent.setEventType(
      ApplicationMetricsConstants.FINISHED_EVENT_TYPE);
  tEvent.setTimestamp(event.getTimestamp());
  Map<String, Object> eventInfo = new HashMap<String, Object>();
  eventInfo.put(ApplicationMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
      event.getDiagnosticsInfo());
  eventInfo.put(ApplicationMetricsConstants.FINAL_STATUS_EVENT_INFO,
      event.getFinalApplicationStatus().toString());
  eventInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO,
      event.getYarnApplicationState().toString());
  if (event.getLatestApplicationAttemptId() != null) {
    eventInfo.put(ApplicationMetricsConstants.LATEST_APP_ATTEMPT_EVENT_INFO,
        event.getLatestApplicationAttemptId().toString());
  }
  RMAppMetrics appMetrics = event.getAppMetrics();
  entity.addOtherInfo(ApplicationMetricsConstants.APP_CPU_METRICS,
      appMetrics.getVcoreSeconds());
  entity.addOtherInfo(ApplicationMetricsConstants.APP_MEM_METRICS,
      appMetrics.getMemorySeconds());
  entity.addOtherInfo(ApplicationMetricsConstants.APP_GPU_METRICS,
      appMetrics.getGcoreSeconds());

  tEvent.setEventInfo(eventInfo);
  entity.addEvent(tEvent);
  putEntity(entity);
}
 
Example 8
Source File: TimelineStoreTestUtils.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Create a test event
 */
private static TimelineEvent createEvent(long timestamp, String type, Map<String,
    Object> info) {
  TimelineEvent event = new TimelineEvent();
  event.setTimestamp(timestamp);
  event.setEventType(type);
  event.setEventInfo(info);
  return event;
}
 
Example 9
Source File: SystemMetricsPublisher.java    From big-c with Apache License 2.0 5 votes vote down vote up
private void publishApplicationFinishedEvent(ApplicationFinishedEvent event) {
  TimelineEntity entity =
      createApplicationEntity(event.getApplicationId());
  TimelineEvent tEvent = new TimelineEvent();
  tEvent.setEventType(
      ApplicationMetricsConstants.FINISHED_EVENT_TYPE);
  tEvent.setTimestamp(event.getTimestamp());
  Map<String, Object> eventInfo = new HashMap<String, Object>();
  eventInfo.put(ApplicationMetricsConstants.DIAGNOSTICS_INFO_EVENT_INFO,
      event.getDiagnosticsInfo());
  eventInfo.put(ApplicationMetricsConstants.FINAL_STATUS_EVENT_INFO,
      event.getFinalApplicationStatus().toString());
  eventInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO,
      event.getYarnApplicationState().toString());
  if (event.getLatestApplicationAttemptId() != null) {
    eventInfo.put(ApplicationMetricsConstants.LATEST_APP_ATTEMPT_EVENT_INFO,
        event.getLatestApplicationAttemptId().toString());
  }
  RMAppMetrics appMetrics = event.getAppMetrics();
  entity.addOtherInfo(ApplicationMetricsConstants.APP_CPU_METRICS,
      appMetrics.getVcoreSeconds());
  entity.addOtherInfo(ApplicationMetricsConstants.APP_MEM_METRICS,
      appMetrics.getMemorySeconds());
  
  tEvent.setEventInfo(eventInfo);
  entity.addEvent(tEvent);
  putEntity(entity);
}
 
Example 10
Source File: TimelineStoreTestUtils.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Create a test event
 */
private static TimelineEvent createEvent(long timestamp, String type, Map<String,
    Object> info) {
  TimelineEvent event = new TimelineEvent();
  event.setTimestamp(timestamp);
  event.setEventType(type);
  event.setEventInfo(info);
  return event;
}
 
Example 11
Source File: HistoryEventTimelineConversion.java    From tez with Apache License 2.0 5 votes vote down vote up
private static TimelineEntity convertVertexReconfigureDoneEvent(
    VertexConfigurationDoneEvent event) {
  TimelineEntity atsEntity = new TimelineEntity();
  atsEntity.setEntityId(event.getVertexID().toString());
  atsEntity.setEntityType(EntityTypes.TEZ_VERTEX_ID.name());

  atsEntity.addPrimaryFilter(ATSConstants.APPLICATION_ID,
      event.getVertexID().getDAGId().getApplicationId().toString());
  atsEntity.addPrimaryFilter(EntityTypes.TEZ_DAG_ID.name(),
      event.getVertexID().getDAGId().toString());

  TimelineEvent updateEvt = new TimelineEvent();
  updateEvt.setEventType(HistoryEventType.VERTEX_CONFIGURE_DONE.name());
  updateEvt.setTimestamp(event.getReconfigureDoneTime());

  Map<String,Object> eventInfo = new HashMap<String, Object>();
  if (event.getSourceEdgeProperties() != null && !event.getSourceEdgeProperties().isEmpty()) {
    Map<String, Object> updatedEdgeManagers = new HashMap<String, Object>();
    for (Entry<String, EdgeProperty> entry :
        event.getSourceEdgeProperties().entrySet()) {
      updatedEdgeManagers.put(entry.getKey(),
          DAGUtils.convertEdgeProperty(entry.getValue()));
    }
    eventInfo.put(ATSConstants.UPDATED_EDGE_MANAGERS, updatedEdgeManagers);
  }
  eventInfo.put(ATSConstants.NUM_TASKS, event.getNumTasks());
  updateEvt.setEventInfo(eventInfo);
  atsEntity.addEvent(updateEvt);

  atsEntity.addOtherInfo(ATSConstants.NUM_TASKS, event.getNumTasks());

  return atsEntity;
}