Class TimelineReaderManager
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderManager
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
@Private
@Unstable
public class TimelineReaderManager
extends org.apache.hadoop.service.AbstractService
This class wraps over the timeline reader store implementation. It does some
non trivial manipulation of the timeline data before or after getting
it from the backend store.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckAccess(org.apache.hadoop.security.UserGroupInformation callerUGI) The API to confirm is a User is allowed to read this data.Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity>getEntities(TimelineReaderContext context, TimelineEntityFilters filters, TimelineDataToRetrieve dataToRetrieve) Get a set of entities matching given predicates by making a call to backend storage implementation.org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntitygetEntity(TimelineReaderContext context, TimelineDataToRetrieve dataToRetrieve) Get single timeline entity by making a call to backend storage implementation.getEntityTypes(TimelineReaderContext context) Gets a list of available timeline entity types for an application.org.apache.hadoop.yarn.api.records.timeline.TimelineHealthCheck if reader connection is alive.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) 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, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Constructor Details
-
TimelineReaderManager
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
getEntities
public Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity> getEntities(TimelineReaderContext context, TimelineEntityFilters filters, TimelineDataToRetrieve dataToRetrieve) throws IOException Get a set of entities matching given predicates by making a call to backend storage implementation. The meaning of each argument has been documented in detail withTimelineReader.getEntities(org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderContext, org.apache.hadoop.yarn.server.timelineservice.reader.TimelineEntityFilters, org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve).If cluster ID has not been supplied by the client, fills the cluster id from config before making a call to backend storage. After fetching entities from backend, fills the appropriate UID based on entity type for each entity.- Parameters:
context- Timeline context within the scope of which entities have to be fetched.filters- Filters which limit the number of entities to be returned.dataToRetrieve- Data to carry in each entity fetched.- Returns:
- a set of TimelineEntity objects.
- Throws:
IOException- if any problem occurs while getting entities.- See Also:
-
getEntity
public org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity getEntity(TimelineReaderContext context, TimelineDataToRetrieve dataToRetrieve) throws IOException Get single timeline entity by making a call to backend storage implementation. The meaning of each argument in detail has been documented withTimelineReader.getEntity(org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderContext, org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve). If cluster ID has not been supplied by the client, fills the cluster id from config before making a call to backend storage. After fetching entity from backend, fills the appropriate UID based on entity type.- Parameters:
context- Timeline context within the scope of which entity has to be fetched.dataToRetrieve- Data to carry in the entity fetched.- Returns:
- A TimelineEntity object if found, null otherwise.
- Throws:
IOException- if any problem occurs while getting entity.- See Also:
-
getEntityTypes
Gets a list of available timeline entity types for an application. This can be done by making a call to the backend storage implementation. The meaning of each argument in detail is the same asTimelineReader.getEntity(org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderContext, org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve). If cluster ID has not been supplied by the client, fills the cluster id from config before making a call to backend storage.- Parameters:
context- Timeline context within the scope of which entity types have to be fetched. Entity type field of this context should be null.- Returns:
- A set which contains available timeline entity types, represented as strings if found, empty otherwise.
- Throws:
IOException- if any problem occurs while getting entity types.
-
checkAccess
public boolean checkAccess(org.apache.hadoop.security.UserGroupInformation callerUGI) The API to confirm is a User is allowed to read this data.- Parameters:
callerUGI- UserGroupInformation of the user- Returns:
- allow return true, not-allow return false.
-
getHealthStatus
public org.apache.hadoop.yarn.api.records.timeline.TimelineHealth getHealthStatus()Check if reader connection is alive.- Returns:
- boolean True if reader connection is alive, false otherwise.
-