Search in sources :

Example 6 with ColumnRangeFilter

use of org.apache.hadoop.hbase.filter.ColumnRangeFilter in project incubator-atlas by apache.

the class HBaseKeyColumnValueStore method getFilter.

public static Filter getFilter(SliceQuery query) {
    byte[] colStartBytes = query.getSliceEnd().length() > 0 ? query.getSliceStart().as(StaticBuffer.ARRAY_FACTORY) : null;
    byte[] colEndBytes = query.getSliceEnd().length() > 0 ? query.getSliceEnd().as(StaticBuffer.ARRAY_FACTORY) : null;
    Filter filter = new ColumnRangeFilter(colStartBytes, true, colEndBytes, false);
    if (query.hasLimit()) {
        filter = new FilterList(FilterList.Operator.MUST_PASS_ALL, filter, new ColumnPaginationFilter(query.getLimit(), 0));
    }
    logger.debug("Generated HBase Filter {}", filter);
    return filter;
}
Also used : ColumnPaginationFilter(org.apache.hadoop.hbase.filter.ColumnPaginationFilter) ColumnRangeFilter(org.apache.hadoop.hbase.filter.ColumnRangeFilter) Filter(org.apache.hadoop.hbase.filter.Filter) ColumnRangeFilter(org.apache.hadoop.hbase.filter.ColumnRangeFilter) FilterList(org.apache.hadoop.hbase.filter.FilterList) ColumnPaginationFilter(org.apache.hadoop.hbase.filter.ColumnPaginationFilter)

Aggregations

ColumnRangeFilter (org.apache.hadoop.hbase.filter.ColumnRangeFilter)6 ColumnPaginationFilter (org.apache.hadoop.hbase.filter.ColumnPaginationFilter)3 Filter (org.apache.hadoop.hbase.filter.Filter)3 FilterList (org.apache.hadoop.hbase.filter.FilterList)3 Test (org.junit.Test)3 Cell (org.apache.hadoop.hbase.Cell)2 KeyValue (org.apache.hadoop.hbase.KeyValue)2 TableName (org.apache.hadoop.hbase.TableName)2 ColumnPrefixFilter (org.apache.hadoop.hbase.filter.ColumnPrefixFilter)2 LinkedHashSet (java.util.LinkedHashSet)1 FirstKeyOnlyFilter (org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter)1 FirstKeyValueMatchingQualifiersFilter (org.apache.hadoop.hbase.filter.FirstKeyValueMatchingQualifiersFilter)1