Class TimelineFilterUtils
java.lang.Object
org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterUtils
Set of utility methods used by timeline filter classes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>>
org.apache.hadoop.hbase.filter.FiltercreateFilterForConfsOrMetricsToRetrieve(org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList confsOrMetricToRetrieve, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnFamily<T> columnFamily, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> columnPrefix) Create filters for confs or metrics to retrieve.static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>>
org.apache.hadoop.hbase.filter.FilterListcreateHBaseFilterList(org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> colPrefix, org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList filterList) Creates equivalent HBaseFilterListfromTimelineFilterListwhile converting different timeline filters(of typeTimelineFilter) into their equivalent HBase filters.static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>>
org.apache.hadoop.hbase.filter.FiltercreateHBaseQualifierFilter(org.apache.hadoop.hbase.filter.CompareFilter.CompareOp compareOp, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> columnPrefix) Create a HBaseQualifierFilterfor the passed column prefix and compare op.static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>>
org.apache.hadoop.hbase.filter.FiltercreateHBaseSingleColValueFilter(org.apache.hadoop.yarn.server.timelineservice.storage.common.Column<T> column, Object value, org.apache.hadoop.hbase.filter.CompareFilter.CompareOp op) Creates a HBaseSingleColumnValueFilterwith specified column.static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>>
org.apache.hadoop.hbase.filter.FilterListcreateSingleColValueFiltersByRange(org.apache.hadoop.yarn.server.timelineservice.storage.common.Column<T> column, Object startValue, Object endValue) Create 2 HBaseSingleColumnValueFilterfilters for the specified value range represented by start and end value and wraps them inside a filter list.fetchColumnsFromFilterList(org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList filterList) Fetch columns from filter list containing exists and multivalue equality filters.
-
Method Details
-
createHBaseQualifierFilter
public static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> org.apache.hadoop.hbase.filter.Filter createHBaseQualifierFilter(org.apache.hadoop.hbase.filter.CompareFilter.CompareOp compareOp, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> columnPrefix) Create a HBaseQualifierFilterfor the passed column prefix and compare op.- Type Parameters:
T- Describes the type of column prefix.- Parameters:
compareOp- compare op.columnPrefix- column prefix.- Returns:
- a column qualifier filter.
-
createFilterForConfsOrMetricsToRetrieve
public static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> org.apache.hadoop.hbase.filter.Filter createFilterForConfsOrMetricsToRetrieve(org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList confsOrMetricToRetrieve, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnFamily<T> columnFamily, org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> columnPrefix) throws IOException Create filters for confs or metrics to retrieve. This list includes a configs/metrics family filter and relevant filters for confs/metrics to retrieve, if present.- Type Parameters:
T- Describes the type of column prefix.- Parameters:
confsOrMetricToRetrieve- configs/metrics to retrieve.columnFamily- config or metric column family.columnPrefix- config or metric column prefix.- Returns:
- a filter list.
- Throws:
IOException- if any problem occurs while creating the filters.
-
createSingleColValueFiltersByRange
public static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> org.apache.hadoop.hbase.filter.FilterList createSingleColValueFiltersByRange(org.apache.hadoop.yarn.server.timelineservice.storage.common.Column<T> column, Object startValue, Object endValue) throws IOException Create 2 HBaseSingleColumnValueFilterfilters for the specified value range represented by start and end value and wraps them inside a filter list. Start and end value should not be null.- Type Parameters:
T- Describes the type of column prefix.- Parameters:
column- Column for which single column value filter is to be created.startValue- Start value.endValue- End value.- Returns:
- 2 single column value filters wrapped in a filter list.
- Throws:
IOException- if any problem is encountered while encoding value.
-
createHBaseSingleColValueFilter
public static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> org.apache.hadoop.hbase.filter.Filter createHBaseSingleColValueFilter(org.apache.hadoop.yarn.server.timelineservice.storage.common.Column<T> column, Object value, org.apache.hadoop.hbase.filter.CompareFilter.CompareOp op) throws IOException Creates a HBaseSingleColumnValueFilterwith specified column.- Type Parameters:
T- Describes the type of column prefix.- Parameters:
column- Column which value to be filtered.value- Value to be filtered.op- Compare operator- Returns:
- a SingleColumnValue Filter
- Throws:
IOException- if any exception.
-
fetchColumnsFromFilterList
public static Set<String> fetchColumnsFromFilterList(org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList filterList) Fetch columns from filter list containing exists and multivalue equality filters. This is done to fetch only required columns from back-end and then match event filters or relationships in reader.- Parameters:
filterList- filter list.- Returns:
- set of columns.
-
createHBaseFilterList
public static <T extends org.apache.hadoop.yarn.server.timelineservice.storage.common.BaseTable<T>> org.apache.hadoop.hbase.filter.FilterList createHBaseFilterList(org.apache.hadoop.yarn.server.timelineservice.storage.common.ColumnPrefix<T> colPrefix, org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList filterList) throws IOException Creates equivalent HBaseFilterListfromTimelineFilterListwhile converting different timeline filters(of typeTimelineFilter) into their equivalent HBase filters.- Type Parameters:
T- Describes the type of column prefix.- Parameters:
colPrefix- column prefix which will be used for conversion.filterList- timeline filter list which has to be converted.- Returns:
- A
FilterListobject. - Throws:
IOException- if any problem occurs while creating the filter list.
-