org.apache.hadoop.yarn.api.records.timeline
Class TimelineEntity

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

@InterfaceAudience.Public
@InterfaceStability.Unstable
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 Summary
TimelineEntity()
           
 
Method Summary
 void addEvent(TimelineEvent event)
          Add a single event related to the entity to the existing event list
 void addEvents(List<TimelineEvent> events)
          Add a list of events related to the entity to the existing event list
 void addOtherInfo(Map<String,Object> otherInfo)
          Add a map of other information of the entity to the existing other info map
 void addOtherInfo(String key, Object value)
          Add one piece of other information of the entity to the existing other info map
 void addPrimaryFilter(String key, Object value)
          Add a single piece of primary filter to the existing primary filter map
 void addPrimaryFilters(Map<String,Set<Object>> primaryFilters)
          Add a map of primary filters to the existing primary filter map
 void addRelatedEntities(Map<String,Set<String>> relatedEntities)
          Add a map of related entities to the existing related entity map
 void addRelatedEntity(String entityType, String entityId)
          Add an entity to the existing related entity map
 int compareTo(TimelineEntity other)
           
 boolean equals(Object obj)
           
 String getDomainId()
          Get the ID of the domain that the entity is to be put
 String getEntityId()
          Get the entity Id
 String getEntityType()
          Get the entity type
 List<TimelineEvent> getEvents()
          Get a list of events related to the entity
 Map<String,Object> getOtherInfo()
          Get the other information of the entity
 Map<String,Set<Object>> getPrimaryFilters()
          Get the primary filters
 Map<String,Set<String>> getRelatedEntities()
          Get the related entities
 Long getStartTime()
          Get the start time of the entity
 int hashCode()
           
 void setDomainId(String domainId)
          Set the ID of the domain that the entity is to be put
 void setEntityId(String entityId)
          Set the entity Id
 void setEntityType(String entityType)
          Set the entity type
 void setEvents(List<TimelineEvent> events)
          Set the event list to the given list of events related to the entity
 void setOtherInfo(Map<String,Object> otherInfo)
          Set the other info map to the given map of other information
 void setPrimaryFilters(Map<String,Set<Object>> primaryFilters)
          Set the primary filter map to the given map of primary filters
 void setRelatedEntities(Map<String,Set<String>> relatedEntities)
          Set the related entity map to the given map of related entities
 void setStartTime(Long startTime)
          Set the start time of the entity
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimelineEntity

public TimelineEntity()
Method Detail

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

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

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

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>


Copyright © 2014 Apache Software Foundation. All Rights Reserved.