Search in sources :

Example 1 with ColumnPaginationFilter

use of org.apache.hadoop.hbase.filter.ColumnPaginationFilter in project janusgraph by JanusGraph.

the class HBaseKeyColumnValueStore method getFilter.

public static Filter getFilter(SliceQuery query) {
    byte[] colStartBytes = query.getSliceStart().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) Filter(org.apache.hadoop.hbase.filter.Filter) ColumnRangeFilter(org.apache.hadoop.hbase.filter.ColumnRangeFilter) ColumnRangeFilter(org.apache.hadoop.hbase.filter.ColumnRangeFilter) FilterList(org.apache.hadoop.hbase.filter.FilterList) ColumnPaginationFilter(org.apache.hadoop.hbase.filter.ColumnPaginationFilter)

Example 2 with ColumnPaginationFilter

use of org.apache.hadoop.hbase.filter.ColumnPaginationFilter in project titan by thinkaurelius.

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) Filter(org.apache.hadoop.hbase.filter.Filter) ColumnRangeFilter(org.apache.hadoop.hbase.filter.ColumnRangeFilter) ColumnRangeFilter(org.apache.hadoop.hbase.filter.ColumnRangeFilter) FilterList(org.apache.hadoop.hbase.filter.FilterList) ColumnPaginationFilter(org.apache.hadoop.hbase.filter.ColumnPaginationFilter)

Example 3 with ColumnPaginationFilter

use of org.apache.hadoop.hbase.filter.ColumnPaginationFilter 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

ColumnPaginationFilter (org.apache.hadoop.hbase.filter.ColumnPaginationFilter)3 ColumnRangeFilter (org.apache.hadoop.hbase.filter.ColumnRangeFilter)3 Filter (org.apache.hadoop.hbase.filter.Filter)3 FilterList (org.apache.hadoop.hbase.filter.FilterList)3