public abstract class TimelineEntityReader extends AbstractTimelineStorageReader
AbstractTimelineStorageReader.FlowContext
Modifier | Constructor and Description |
---|---|
protected |
TimelineEntityReader(org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderContext ctxt,
org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve toRetrieve)
Instantiates a reader for single-entity reads.
|
protected |
TimelineEntityReader(org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderContext ctxt,
org.apache.hadoop.yarn.server.timelineservice.reader.TimelineEntityFilters entityFilters,
org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve toRetrieve)
Instantiates a reader for multiple-entity reads.
|
Modifier and Type | Method and Description |
---|---|
protected abstract org.apache.hadoop.hbase.filter.FilterList |
constructFilterListBasedOnFields(Set<String> cfsInFields)
Creates a
FilterList based on fields, confs and metrics to
retrieve. |
protected abstract org.apache.hadoop.hbase.filter.FilterList |
constructFilterListBasedOnFilters()
Creates a
FilterList based on info, config and metric filters. |
protected <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> |
createColQualifierPrefix(org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> colPrefix,
String column) |
protected <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> |
createFiltersFromColumnQualifiers(org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> colPrefix,
Set<String> columns)
Create a filter list of qualifier filters based on passed set of columns.
|
protected void |
createFiltersIfNull()
Create a
TimelineEntityFilters object with default values for
filters. |
protected org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve |
getDataToRetrieve() |
protected org.apache.hadoop.yarn.server.timelineservice.reader.TimelineEntityFilters |
getFilters() |
protected abstract org.apache.hadoop.hbase.client.Result |
getResult(org.apache.hadoop.conf.Configuration hbaseConf,
org.apache.hadoop.hbase.client.Connection conn,
org.apache.hadoop.hbase.filter.FilterList filterList)
Fetches a
Result instance for a single-entity read. |
protected abstract org.apache.hadoop.hbase.client.ResultScanner |
getResults(org.apache.hadoop.conf.Configuration hbaseConf,
org.apache.hadoop.hbase.client.Connection conn,
org.apache.hadoop.hbase.filter.FilterList filterList)
Fetches a
ResultScanner for a multi-entity read. |
protected BaseTableRW<?> |
getTable()
Returns the main table to be used by the entity reader.
|
protected boolean |
hasField(EnumSet<org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader.Field> fieldsToRetrieve,
org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader.Field requiredField)
Check if we have a certain field amongst fields to retrieve.
|
boolean |
isSingleEntityRead()
Checks whether the reader has been created to fetch single entity or
multiple entities.
|
protected abstract org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity |
parseEntity(org.apache.hadoop.hbase.client.Result result)
Parses the result retrieved from HBase backend and convert it into a
TimelineEntity object. |
Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity> |
readEntities(org.apache.hadoop.conf.Configuration hbaseConf,
org.apache.hadoop.hbase.client.Connection conn)
Reads and deserializes a set of timeline entities from the HBase storage.
|
org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity |
readEntity(org.apache.hadoop.conf.Configuration hbaseConf,
org.apache.hadoop.hbase.client.Connection conn)
Reads and deserializes a single timeline entity from the HBase storage.
|
protected static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> |
readEvents(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity entity,
org.apache.hadoop.hbase.client.Result result,
org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> prefix)
Read events from the entity table or the application table.
|
protected void |
readMetrics(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity entity,
org.apache.hadoop.hbase.client.Result result,
org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<?> columnPrefix)
Helper method for reading and deserializing
TimelineMetric objects
using the specified column prefix. |
protected <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> |
readRelationship(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity entity,
org.apache.hadoop.hbase.client.Result result,
org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> prefix,
boolean isRelatedTo)
Helper method for reading relationship.
|
protected void |
setTable(BaseTableRW<?> baseTable) |
augmentParams, defaultAugmentParams, getContext, lookupFlowContext, validateParams
protected TimelineEntityReader(org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderContext ctxt, org.apache.hadoop.yarn.server.timelineservice.reader.TimelineEntityFilters entityFilters, org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve toRetrieve)
ctxt
- Reader context which defines the scope in which query has to be
made.entityFilters
- Filters which limit the entities returned.toRetrieve
- Data to retrieve for each entity.protected TimelineEntityReader(org.apache.hadoop.yarn.server.timelineservice.reader.TimelineReaderContext ctxt, org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve toRetrieve)
ctxt
- Reader context which defines the scope in which query has to be
made.toRetrieve
- Data to retrieve for each entity.protected abstract org.apache.hadoop.hbase.filter.FilterList constructFilterListBasedOnFields(Set<String> cfsInFields) throws IOException
FilterList
based on fields, confs and metrics to
retrieve. This filter list will be set in Scan/Get objects to trim down
results fetched from HBase back-end storage. This is called only for
multiple entity reads.cfsInFields
- column families in the fieldsFilterList
object.IOException
- if any problem occurs while creating filter list.protected abstract org.apache.hadoop.hbase.filter.FilterList constructFilterListBasedOnFilters() throws IOException
FilterList
based on info, config and metric filters. This
filter list will be set in HBase Get to trim down results fetched from
HBase back-end storage.FilterList
object.IOException
- if any problem occurs while creating filter list.protected org.apache.hadoop.yarn.server.timelineservice.reader.TimelineDataToRetrieve getDataToRetrieve()
protected org.apache.hadoop.yarn.server.timelineservice.reader.TimelineEntityFilters getFilters()
protected void createFiltersIfNull()
TimelineEntityFilters
object with default values for
filters.public org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity readEntity(org.apache.hadoop.conf.Configuration hbaseConf, org.apache.hadoop.hbase.client.Connection conn) throws IOException
hbaseConf
- HBase Configuration.conn
- HBase Connection.IOException
- if there is any exception encountered while reading
entity.public Set<org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity> readEntities(org.apache.hadoop.conf.Configuration hbaseConf, org.apache.hadoop.hbase.client.Connection conn) throws IOException
hbaseConf
- HBase Configuration.conn
- HBase Connection.IOException
- if any exception is encountered while reading entities.protected BaseTableRW<?> getTable()
protected abstract org.apache.hadoop.hbase.client.Result getResult(org.apache.hadoop.conf.Configuration hbaseConf, org.apache.hadoop.hbase.client.Connection conn, org.apache.hadoop.hbase.filter.FilterList filterList) throws IOException
Result
instance for a single-entity read.hbaseConf
- HBase Configuration.conn
- HBase Connection.filterList
- filter list which will be applied to HBase Get.Result
instance or null if no such record is found.IOException
- if any exception is encountered while getting result.protected abstract org.apache.hadoop.hbase.client.ResultScanner getResults(org.apache.hadoop.conf.Configuration hbaseConf, org.apache.hadoop.hbase.client.Connection conn, org.apache.hadoop.hbase.filter.FilterList filterList) throws IOException
ResultScanner
for a multi-entity read.hbaseConf
- HBase Configuration.conn
- HBase Connection.filterList
- filter list which will be applied to HBase Scan.ResultScanner
instance.IOException
- if any exception is encountered while getting results.protected abstract org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity parseEntity(org.apache.hadoop.hbase.client.Result result) throws IOException
TimelineEntity
object.result
- Single row result of a Get/Scan.IOException
- if any exception is encountered while parsing entity.protected void readMetrics(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity entity, org.apache.hadoop.hbase.client.Result result, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<?> columnPrefix) throws IOException
TimelineMetric
objects
using the specified column prefix. The timeline metrics then are added to
the given timeline entity.entity
- TimelineEntity
object.result
- Result
object retrieved from backend.columnPrefix
- Metric column prefixIOException
- if any exception is encountered while reading metrics.public boolean isSingleEntityRead()
protected void setTable(BaseTableRW<?> baseTable)
protected boolean hasField(EnumSet<org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader.Field> fieldsToRetrieve, org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader.Field requiredField)
TimelineReader.Field.ALL
as well because that would mean field
passed needs to be matched.fieldsToRetrieve
- fields to be retrieved.requiredField
- fields to be checked in fieldsToRetrieve.protected <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> org.apache.hadoop.hbase.filter.FilterList createFiltersFromColumnQualifiers(org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> colPrefix, Set<String> columns)
T
- Describes the type of column prefix.colPrefix
- Column Prefix.columns
- set of column qualifiers.protected <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> byte[] createColQualifierPrefix(org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> colPrefix, String column)
protected <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> void readRelationship(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity entity, org.apache.hadoop.hbase.client.Result result, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> prefix, boolean isRelatedTo) throws IOException
T
- Describes the type of column prefix.entity
- entity to fill.result
- result from HBase.prefix
- column prefix.isRelatedTo
- if true, means relationship is to be added to
isRelatedTo, otherwise its added to relatesTo.IOException
- if any problem is encountered while reading result.protected static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> void readEvents(org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntity entity, org.apache.hadoop.hbase.client.Result result, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> prefix) throws IOException
T
- Describes the type of column prefix.entity
- entity to fill.result
- HBase Result.prefix
- column prefix.IOException
- if any problem is encountered while reading result.Copyright © 2008–2022 Apache Software Foundation. All rights reserved.