Class TimelineEntity

java.lang.Object
org.apache.hadoop.yarn.api.records.timeline.TimelineEntity
All Implemented Interfaces:
Comparable<TimelineEntity>

@Public @Evolving public class TimelineEntity extends Object implements Comparable<TimelineEntity>

The class that contains the the meta information of some conceptual entity and its related events. The entity can be an application, an application attempt, a container or whatever the user-defined object.

Primary filters will be used to index the entities in TimelineStore, such that users should carefully choose the information they want to store as the primary filters. The remaining can be stored as other information.

  • Constructor Details

    • TimelineEntity

      public TimelineEntity()
  • Method Details

    • getEntityType

      public String getEntityType()
      Get the entity type
      Returns:
      the entity type
    • setEntityType

      public void setEntityType(String entityType)
      Set the entity type
      Parameters:
      entityType - the entity type
    • getEntityId

      public String getEntityId()
      Get the entity Id
      Returns:
      the entity Id
    • setEntityId

      public void setEntityId(String entityId)
      Set the entity Id
      Parameters:
      entityId - the entity Id
    • getStartTime

      public Long getStartTime()
      Get the start time of the entity
      Returns:
      the start time of the entity
    • setStartTime

      public void setStartTime(Long startTime)
      Set the start time of the entity
      Parameters:
      startTime - the start time of the entity
    • getEvents

      public List<TimelineEvent> getEvents()
      Get a list of events related to the entity
      Returns:
      a list of events related to the entity
    • addEvent

      public void addEvent(TimelineEvent event)
      Add a single event related to the entity to the existing event list
      Parameters:
      event - a single event related to the entity
    • addEvents

      public void addEvents(List<TimelineEvent> events)
      Add a list of events related to the entity to the existing event list
      Parameters:
      events - a list of events related to the entity
    • setEvents

      public void setEvents(List<TimelineEvent> events)
      Set the event list to the given list of events related to the entity
      Parameters:
      events - events a list of events related to the entity
    • getRelatedEntities

      public Map<String,Set<String>> getRelatedEntities()
      Get the related entities
      Returns:
      the related entities
    • getRelatedEntitiesJAXB

      @Private public HashMap<String,Set<String>> getRelatedEntitiesJAXB()
    • addRelatedEntity

      public void addRelatedEntity(String entityType, String entityId)
      Add an entity to the existing related entity map
      Parameters:
      entityType - the entity type
      entityId - the entity Id
    • addRelatedEntities

      public void addRelatedEntities(Map<String,Set<String>> relatedEntities)
      Add a map of related entities to the existing related entity map
      Parameters:
      relatedEntities - a map of related entities
    • setRelatedEntities

      public void setRelatedEntities(Map<String,Set<String>> relatedEntities)
      Set the related entity map to the given map of related entities
      Parameters:
      relatedEntities - a map of related entities
    • getPrimaryFilters

      public Map<String,Set<Object>> getPrimaryFilters()
      Get the primary filters
      Returns:
      the primary filters
    • getPrimaryFiltersJAXB

      @Private public HashMap<String,Set<Object>> getPrimaryFiltersJAXB()
    • addPrimaryFilter

      public void addPrimaryFilter(String key, Object value)
      Add a single piece of primary filter to the existing primary filter map
      Parameters:
      key - the primary filter key
      value - the primary filter value
    • addPrimaryFilters

      public void addPrimaryFilters(Map<String,Set<Object>> primaryFilters)
      Add a map of primary filters to the existing primary filter map
      Parameters:
      primaryFilters - a map of primary filters
    • setPrimaryFilters

      public void setPrimaryFilters(Map<String,Set<Object>> primaryFilters)
      Set the primary filter map to the given map of primary filters
      Parameters:
      primaryFilters - a map of primary filters
    • getOtherInfo

      public Map<String,Object> getOtherInfo()
      Get the other information of the entity
      Returns:
      the other information of the entity
    • getOtherInfoJAXB

      @Private public HashMap<String,Object> getOtherInfoJAXB()
    • addOtherInfo

      public void addOtherInfo(String key, Object value)
      Add one piece of other information of the entity to the existing other info map
      Parameters:
      key - the other information key
      value - the other information value
    • addOtherInfo

      public void addOtherInfo(Map<String,Object> otherInfo)
      Add a map of other information of the entity to the existing other info map
      Parameters:
      otherInfo - a map of other information
    • setOtherInfo

      public void setOtherInfo(Map<String,Object> otherInfo)
      Set the other info map to the given map of other information
      Parameters:
      otherInfo - a map of other information
    • getDomainId

      public String getDomainId()
      Get the ID of the domain that the entity is to be put
      Returns:
      the domain ID
    • setDomainId

      public void setDomainId(String domainId)
      Set the ID of the domain that the entity is to be put
      Parameters:
      domainId - the name space ID
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(TimelineEntity other)
      Specified by:
      compareTo in interface Comparable<TimelineEntity>