Class NoOpTimelineReaderImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service,TimelineReader
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATENested classes/interfaces inherited from interface org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader
TimelineReader.Field -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet<org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity>getEntities(TimelineReaderContext context, TimelineEntityFilters filters, TimelineDataToRetrieve dataToRetrieve) The API to search for a set of entities of the given entity type in the scope of the given context which matches the given predicates.org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntitygetEntity(TimelineReaderContext context, TimelineDataToRetrieve dataToRetrieve) The API to fetch the single entity given the identifier(depending on the entity type) in the scope of the given context.getEntityTypes(TimelineReaderContext context) The API to list all available entity types of the given context.org.apache.hadoop.yarn.api.records.timeline.TimelineHealthCheck if reader connection is working properly.Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.service.Service
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
NoOpTimelineReaderImpl
public NoOpTimelineReaderImpl()
-
-
Method Details
-
getEntity
public org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity getEntity(TimelineReaderContext context, TimelineDataToRetrieve dataToRetrieve) throws IOException Description copied from interface:TimelineReaderThe API to fetch the single entity given the identifier(depending on the entity type) in the scope of the given context.
- Specified by:
getEntityin interfaceTimelineReader- Parameters:
context- Context which defines the scope in which query has to be made. Use getters ofTimelineReaderContextto fetch context fields. Context contains the following :
- entityType - Entity type(mandatory).
- clusterId - Identifies the cluster(mandatory).
- userId - Identifies the user.
- flowName - Context flow name.
- flowRunId - Context flow run id.
- appId - Context app id.
- entityId - Entity id.
- If entity type is YARN_FLOW_RUN (i.e. query to fetch a specific flow run), clusterId, userId, flowName and flowRunId are mandatory.
- If entity type is YARN_APPLICATION (i.e. query to fetch a specific app), query is within the scope of clusterId, userId, flowName, flowRunId and appId. But out of this, only clusterId and appId are mandatory. If only clusterId and appId are supplied, backend storage must fetch the flow context information i.e. userId, flowName and flowRunId first and based on that, fetch the app. If flow context information is also given, app can be directly fetched.
- For other entity types (i.e. query to fetch generic entity), query is within the scope of clusterId, userId, flowName, flowRunId, appId, entityType and entityId. But out of this, only clusterId, appId, entityType and entityId are mandatory. If flow context information is not supplied, backend storage must fetch the flow context information i.e. userId, flowName and flowRunId first and based on that, fetch the entity. If flow context information is also given, entity can be directly queried.
dataToRetrieve- Specifies which data to retrieve for the entity. Use getters of TimelineDataToRetrieve class to fetch dataToRetrieve fields. All the dataToRetrieve fields are optional. Refer toTimelineDataToRetrievefor details.- Returns:
- A TimelineEntity instance or null. The entity will
contain the metadata plus the given fields to retrieve.
If entityType is YARN_FLOW_RUN, entity returned is of type FlowRunEntity.
For all other entity types, entity returned is of type TimelineEntity. - Throws:
IOException- if there is an exception encountered while fetching entity from backend storage.
-
getEntities
public Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity> getEntities(TimelineReaderContext context, TimelineEntityFilters filters, TimelineDataToRetrieve dataToRetrieve) throws IOException Description copied from interface:TimelineReaderThe API to search for a set of entities of the given entity type in the scope of the given context which matches the given predicates. The predicates include the created time window, limit to number of entities to be returned, and the entities can be filtered by checking whether they contain the given info/configs entries in the form of key/value pairs, given metrics in the form of metricsIds and its relation with metric values, given events in the form of the Ids, and whether they relate to/are related to other entities. For those parameters which have multiple entries, the qualified entity needs to meet all or them.
- Specified by:
getEntitiesin interfaceTimelineReader- Parameters:
context- Context which defines the scope in which query has to be made. Use getters ofTimelineReaderContextto fetch context fields. Context contains the following :
- entityType - Entity type(mandatory).
- clusterId - Identifies the cluster(mandatory).
- userId - Identifies the user.
- flowName - Context flow name.
- flowRunId - Context flow run id.
- appId - Context app id.
Fields in context which are mandatory depends on entity type. Entity type is always mandatory. In addition to entity type, below is the list of context fields which are mandatory, based on entity type.
- If entity type is YARN_FLOW_ACTIVITY (i.e. query to fetch flows), only clusterId is mandatory.
- If entity type is YARN_FLOW_RUN (i.e. query to fetch flow runs), clusterId, userId and flowName are mandatory.
- If entity type is YARN_APPLICATION (i.e. query to fetch apps), we can either get all apps within the context of flow name or within the context of flow run. If apps are queried within the scope of flow name, clusterId, userId and flowName are supplied. If they are queried within the scope of flow run, clusterId, userId, flowName and flowRunId are supplied.
- For other entity types (i.e. query to fetch generic entities), query is within the scope of clusterId, userId, flowName, flowRunId, appId and entityType. But out of this, only clusterId, appId and entityType are mandatory. If flow context information is not supplied, backend storage must fetch the flow context information i.e. userId, flowName and flowRunId first and based on that, fetch the entities. If flow context information is also given, entities can be directly queried.
filters- Specifies filters which restrict the number of entities to return. Use getters of TimelineEntityFilters class to fetch various filters. All the filters are optional. Refer toTimelineEntityFiltersfor details.dataToRetrieve- Specifies which data to retrieve for each entity. Use getters of TimelineDataToRetrieve class to fetch dataToRetrieve fields. All the dataToRetrieve fields are optional. Refer toTimelineDataToRetrievefor details.- Returns:
- A set of TimelineEntity instances of the given entity
type in the given context scope which matches the given predicates
ordered by enitityIdPrefix(for generic entities only).
Each entity will only contain
the metadata(id, type , idPrefix and created time) plus the given
fields to retrieve.
If entityType is YARN_FLOW_ACTIVITY, entities returned are of type FlowActivityEntity.
If entityType is YARN_FLOW_RUN, entities returned are of type FlowRunEntity.
For all other entity types, entities returned are of type TimelineEntity. - Throws:
IOException- if there is an exception encountered while fetching entity from backend storage.
-
getEntityTypes
Description copied from interface:TimelineReaderThe API to list all available entity types of the given context.- Specified by:
getEntityTypesin interfaceTimelineReader- Parameters:
context- A context defines the scope of this query. The incoming context should contain at least the cluster id and application id.- Returns:
- A set of entity types available in the given context.
- Throws:
IOException- if an exception occurred while listing from backend storage.
-
getHealthStatus
public org.apache.hadoop.yarn.api.records.timeline.TimelineHealth getHealthStatus()Description copied from interface:TimelineReaderCheck if reader connection is working properly.- Specified by:
getHealthStatusin interfaceTimelineReader- Returns:
- True if reader connection works as expected, false otherwise.
-