public class FileSystemTimelineReaderImpl extends org.apache.hadoop.service.AbstractService implements TimelineReader
TimelineReader.Field
Modifier and Type | Field and Description |
---|---|
static String |
TIMELINE_SERVICE_STORAGE_DIR_ROOT
Config param for timeline service file system storage root.
|
Constructor and Description |
---|
FileSystemTimelineReaderImpl() |
Modifier and Type | Method and Description |
---|---|
Set<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.TimelineEntity |
getEntity(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.
|
Set<String> |
getEntityTypes(TimelineReaderContext context)
The API to list all available entity types of the given context.
|
static <T> T |
getTimelineRecordFromJSON(String jsonString,
Class<T> clazz)
Deserialize a POJO object from a JSON string.
|
void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
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
public static final String TIMELINE_SERVICE_STORAGE_DIR_ROOT
public static <T> T getTimelineRecordFromJSON(String jsonString, Class<T> clazz) throws org.codehaus.jackson.JsonGenerationException, org.codehaus.jackson.map.JsonMappingException, IOException
T
- Describes the type of class to be returned.clazz
- class to be deserialized.jsonString
- JSON string to deserialize.IOException
- if the underlying input source has problems during
parsing.org.codehaus.jackson.map.JsonMappingException
- if parser has problems parsing content.org.codehaus.jackson.JsonGenerationException
- if there is a problem in JSON writing.public void serviceInit(org.apache.hadoop.conf.Configuration conf) throws Exception
serviceInit
in class org.apache.hadoop.service.AbstractService
Exception
public org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity getEntity(TimelineReaderContext context, TimelineDataToRetrieve dataToRetrieve) throws IOException
TimelineReader
The API to fetch the single entity given the identifier(depending on the entity type) in the scope of the given context.
getEntity
in interface TimelineReader
context
- Context which defines the scope in which query has to be
made. Use getters of TimelineReaderContext
to fetch context
fields. Context contains the following :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 to
TimelineDataToRetrieve
for details.IOException
- if there is an exception encountered while fetching
entity from backend storage.public Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity> getEntities(TimelineReaderContext context, TimelineEntityFilters filters, TimelineDataToRetrieve dataToRetrieve) throws IOException
TimelineReader
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. 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.
getEntities
in interface TimelineReader
context
- Context which defines the scope in which query has to be
made. Use getters of TimelineReaderContext
to fetch context
fields. Context contains the following :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 to
TimelineEntityFilters
for 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 to
TimelineDataToRetrieve
for details.IOException
- if there is an exception encountered while fetching
entity from backend storage.public Set<String> getEntityTypes(TimelineReaderContext context) throws IOException
TimelineReader
getEntityTypes
in interface TimelineReader
context
- A context defines the scope of this query. The incoming
context should contain at least the cluster id and application id.IOException
- if an exception occurred while listing from backend
storage.Copyright © 2022 Apache Software Foundation. All rights reserved.