Class TimelineEntity
java.lang.Object
org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity
- All Implemented Interfaces:
Comparable<TimelineEntity>
- Direct Known Subclasses:
FlowActivityEntity,HierarchicalTimelineEntity,UserEntity
The basic timeline entity data structure for timeline service v2. Timeline
entity objects are not thread safe and should not be accessed concurrently.
All collection members will be initialized into empty collections. Two
timeline entities are equal iff. their type and id are identical.
All non-primitive type, non-collection members will be initialized into null.
User should set the type and id of a timeline entity to make it valid (can be
checked by using the
isValid() method). Callers to the getters
should perform null checks for non-primitive type, non-collection members.
Callers are recommended not to alter the returned collection objects from the
getters.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIdentifier of timeline entity(entity id + entity type). -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTimelineEntity(String type) TimelineEntity(TimelineEntity entity) The constuctor is used to construct a proxyTimelineEntityor its subclass object from the real entity object that carries information. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddConfigs(Map<String, String> entityConfigs) voidaddEvent(TimelineEvent event) voidaddEvents(Set<TimelineEvent> entityEvents) voidvoidvoidaddIsRelatedToEntities(Map<String, Set<String>> isRelatedTo) voidaddIsRelatedToEntity(String type, String id) voidaddMetric(TimelineMetric metric) voidaddMetrics(Set<TimelineMetric> entityMetrics) voidaddRelatesToEntities(Map<String, Set<String>> relatesTo) voidaddRelatesToEntity(String type, String id) intcompareTo(TimelineEntity other) booleangetId()longgetInfo()protected TimelineEntitygetReal()getType()inthashCode()booleanisValid()voidsetConfigs(Map<String, String> entityConfigs) voidsetCreatedTime(Long createdTs) voidsetEvents(NavigableSet<TimelineEvent> entityEvents) voidvoidsetIdentifier(TimelineEntity.Identifier entityIdentifier) voidsetIdPrefix(long entityIdPrefix) Sets idPrefix for an entity.voidvoidsetIsRelatedToEntities(Map<String, Set<String>> isRelatedTo) voidsetMetrics(Set<TimelineMetric> entityMetrics) voidsetRelatesToEntities(Map<String, Set<String>> relatesTo) voidvoidSet UID in info which will be then used for query by UI.toString()
-
Field Details
-
SYSTEM_INFO_KEY_PREFIX
- See Also:
-
DEFAULT_ENTITY_PREFIX
public static final long DEFAULT_ENTITY_PREFIX- See Also:
-
-
Constructor Details
-
TimelineEntity
public TimelineEntity() -
TimelineEntity
The constuctor is used to construct a proxy
TimelineEntityor its subclass object from the real entity object that carries information.It is usually used in the case where we want to recover class polymorphism after deserializing the entity from its JSON form.
- Parameters:
entity- the real entity that carries information
-
TimelineEntity
-
-
Method Details
-
getType
-
setType
-
getId
-
setId
-
getIdentifier
-
setIdentifier
-
getInfoJAXB
-
getInfo
-
setInfo
-
addInfo
-
addInfo
-
getConfigsJAXB
-
getConfigs
-
setConfigs
-
addConfigs
-
addConfig
-
getMetrics
-
setMetrics
-
addMetrics
-
addMetric
-
getEvents
-
addEvents
-
addEvent
-
getIsRelatedToEntities
-
getIsRelatedToEntitiesJAXB
-
setIsRelatedToEntities
-
addIsRelatedToEntities
-
addIsRelatedToEntity
-
getRelatesToEntitiesJAXB
-
getRelatesToEntities
-
addRelatesToEntities
-
addRelatesToEntity
-
setRelatesToEntities
-
getCreatedTime
-
setCreatedTime
-
setUID
Set UID in info which will be then used for query by UI.- Parameters:
uidKey- key for UID in info.uId- UID to be set for the key.
-
isValid
public boolean isValid() -
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<TimelineEntity>
-
getReal
-
toString
-
getIdPrefix
public long getIdPrefix() -
setIdPrefix
public void setIdPrefix(long entityIdPrefix) Sets idPrefix for an entity.Note: Entities will be stored in the order of idPrefix specified. If users decide to set idPrefix for an entity, they MUST provide the same prefix for every update of this entity.
Example:
Users can useTimelineEntity entity = new TimelineEntity(); entity.setIdPrefix(value);
TimelineServiceHelper.invertLong(long)to invert the prefix if necessary.- Parameters:
entityIdPrefix- prefix for an entity.
-