org.apache.hadoop.yarn.server.timeline
Interface TimelineReader

All Known Subinterfaces:
TimelineStore
All Known Implementing Classes:
LeveldbTimelineStore, MemoryTimelineStore

@InterfaceAudience.Private
@InterfaceStability.Unstable
public interface TimelineReader

This interface is for retrieving timeline information.


Nested Class Summary
static class TimelineReader.Field
          Possible fields to retrieve for getEntities(java.lang.String, java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String, java.lang.Long, org.apache.hadoop.yarn.server.timeline.NameValuePair, java.util.Collection, java.util.EnumSet) and getEntity(java.lang.String, java.lang.String, java.util.EnumSet) .
 
Field Summary
static long DEFAULT_LIMIT
          Default limit for getEntities(java.lang.String, java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String, java.lang.Long, org.apache.hadoop.yarn.server.timeline.NameValuePair, java.util.Collection, java.util.EnumSet) and getEntityTimelines(java.lang.String, java.util.SortedSet, java.lang.Long, java.lang.Long, java.lang.Long, java.util.Set).
 
Method Summary
 org.apache.hadoop.yarn.api.records.timeline.TimelineDomain getDomain(String domainId)
          This method retrieves the domain information for a given ID.
 org.apache.hadoop.yarn.api.records.timeline.TimelineDomains getDomains(String owner)
          This method retrieves all the domains that belong to a given owner.
 org.apache.hadoop.yarn.api.records.timeline.TimelineEntities getEntities(String entityType, Long limit, Long windowStart, Long windowEnd, String fromId, Long fromTs, NameValuePair primaryFilter, Collection<NameValuePair> secondaryFilters, EnumSet<TimelineReader.Field> fieldsToRetrieve)
          This method retrieves a list of entity information, TimelineEntity, sorted by the starting timestamp for the entity, descending.
 org.apache.hadoop.yarn.api.records.timeline.TimelineEntity getEntity(String entityId, String entityType, EnumSet<TimelineReader.Field> fieldsToRetrieve)
          This method retrieves the entity information for a given entity.
 org.apache.hadoop.yarn.api.records.timeline.TimelineEvents getEntityTimelines(String entityType, SortedSet<String> entityIds, Long limit, Long windowStart, Long windowEnd, Set<String> eventTypes)
          This method retrieves the events for a list of entities all of the same entity type.
 

Field Detail

DEFAULT_LIMIT

static final long DEFAULT_LIMIT
Default limit for getEntities(java.lang.String, java.lang.Long, java.lang.Long, java.lang.Long, java.lang.String, java.lang.Long, org.apache.hadoop.yarn.server.timeline.NameValuePair, java.util.Collection, java.util.EnumSet) and getEntityTimelines(java.lang.String, java.util.SortedSet, java.lang.Long, java.lang.Long, java.lang.Long, java.util.Set).

See Also:
Constant Field Values
Method Detail

getEntities

org.apache.hadoop.yarn.api.records.timeline.TimelineEntities getEntities(String entityType,
                                                                         Long limit,
                                                                         Long windowStart,
                                                                         Long windowEnd,
                                                                         String fromId,
                                                                         Long fromTs,
                                                                         NameValuePair primaryFilter,
                                                                         Collection<NameValuePair> secondaryFilters,
                                                                         EnumSet<TimelineReader.Field> fieldsToRetrieve)
                                                                         throws IOException
This method retrieves a list of entity information, TimelineEntity, sorted by the starting timestamp for the entity, descending. The starting timestamp of an entity is a timestamp specified by the client. If it is not explicitly specified, it will be chosen by the store to be the earliest timestamp of the events received in the first put for the entity.

Parameters:
entityType - The type of entities to return (required).
limit - A limit on the number of entities to return. If null, defaults to DEFAULT_LIMIT.
windowStart - The earliest start timestamp to retrieve (exclusive). If null, defaults to retrieving all entities until the limit is reached.
windowEnd - The latest start timestamp to retrieve (inclusive). If null, defaults to Long.MAX_VALUE
fromId - If fromId is not null, retrieve entities earlier than and including the specified ID. If no start time is found for the specified ID, an empty list of entities will be returned. The windowEnd parameter will take precedence if the start time of this entity falls later than windowEnd.
fromTs - If fromTs is not null, ignore entities that were inserted into the store after the given timestamp. The entity's insert timestamp used for this comparison is the store's system time when the first put for the entity was received (not the entity's start time).
primaryFilter - Retrieves only entities that have the specified primary filter. If null, retrieves all entities. This is an indexed retrieval, and no entities that do not match the filter are scanned.
secondaryFilters - Retrieves only entities that have exact matches for all the specified filters in their primary filters or other info. This is not an indexed retrieval, so all entities are scanned but only those matching the filters are returned.
fieldsToRetrieve - Specifies which fields of the entity object to retrieve (see TimelineReader.Field). If the set of fields contains TimelineReader.Field.LAST_EVENT_ONLY and not TimelineReader.Field.EVENTS, the most recent event for each entity is retrieved. If null, retrieves all fields.
Returns:
An TimelineEntities object.
Throws:
IOException

getEntity

org.apache.hadoop.yarn.api.records.timeline.TimelineEntity getEntity(String entityId,
                                                                     String entityType,
                                                                     EnumSet<TimelineReader.Field> fieldsToRetrieve)
                                                                     throws IOException
This method retrieves the entity information for a given entity.

Parameters:
entityId - The entity whose information will be retrieved.
entityType - The type of the entity.
fieldsToRetrieve - Specifies which fields of the entity object to retrieve (see TimelineReader.Field). If the set of fields contains TimelineReader.Field.LAST_EVENT_ONLY and not TimelineReader.Field.EVENTS, the most recent event for each entity is retrieved. If null, retrieves all fields.
Returns:
An TimelineEntity object.
Throws:
IOException

getEntityTimelines

org.apache.hadoop.yarn.api.records.timeline.TimelineEvents getEntityTimelines(String entityType,
                                                                              SortedSet<String> entityIds,
                                                                              Long limit,
                                                                              Long windowStart,
                                                                              Long windowEnd,
                                                                              Set<String> eventTypes)
                                                                              throws IOException
This method retrieves the events for a list of entities all of the same entity type. The events for each entity are sorted in order of their timestamps, descending.

Parameters:
entityType - The type of entities to retrieve events for.
entityIds - The entity IDs to retrieve events for.
limit - A limit on the number of events to return for each entity. If null, defaults to DEFAULT_LIMIT events per entity.
windowStart - If not null, retrieves only events later than the given time (exclusive)
windowEnd - If not null, retrieves only events earlier than the given time (inclusive)
eventTypes - Restricts the events returned to the given types. If null, events of all types will be returned.
Returns:
An TimelineEvents object.
Throws:
IOException

getDomain

org.apache.hadoop.yarn.api.records.timeline.TimelineDomain getDomain(String domainId)
                                                                     throws IOException
This method retrieves the domain information for a given ID.

Returns:
a TimelineDomain object.
Throws:
IOException

getDomains

org.apache.hadoop.yarn.api.records.timeline.TimelineDomains getDomains(String owner)
                                                                       throws IOException
This method retrieves all the domains that belong to a given owner. The domains are sorted according to the created time firstly and the modified time secondly in descending order.

Parameters:
owner - the domain owner
Returns:
an TimelineDomains object.
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.