use of org.apache.hadoop.hbase.filter.FilterList in project cdap by caskdata.
the class Filters method combine.
/**
* Adds {@code overrideFilter} on to {@code baseFilter}, if it exists, otherwise replaces it.
*/
public static Filter combine(Filter overrideFilter, Filter baseFilter) {
if (baseFilter != null) {
FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);
filterList.addFilter(baseFilter);
filterList.addFilter(overrideFilter);
return filterList;
}
return overrideFilter;
}
use of org.apache.hadoop.hbase.filter.FilterList in project cdap by caskdata.
the class Filters method combine.
/**
* Adds {@code overrideFilter} on to {@code baseFilter}, if it exists, otherwise replaces it.
*/
public static Filter combine(Filter overrideFilter, Filter baseFilter) {
if (baseFilter != null) {
FilterList filterList = new FilterList(FilterList.Operator.MUST_PASS_ALL);
filterList.addFilter(baseFilter);
filterList.addFilter(overrideFilter);
return filterList;
}
return overrideFilter;
}
use of org.apache.hadoop.hbase.filter.FilterList in project hive by apache.
the class HBaseScanRange method setup.
public void setup(Scan scan, Configuration conf, boolean filterOnly) throws Exception {
if (!filterOnly) {
// Set the start and stop rows only if asked to
if (startRow != null) {
scan.setStartRow(startRow);
}
if (stopRow != null) {
scan.setStopRow(stopRow);
}
}
if (filterDescs.isEmpty()) {
return;
}
if (filterDescs.size() == 1) {
scan.setFilter(filterDescs.get(0).toFilter(conf));
return;
}
List<Filter> filters = new ArrayList<Filter>();
for (FilterDesc filter : filterDescs) {
filters.add(filter.toFilter(conf));
}
scan.setFilter(new FilterList(filters));
}
use of org.apache.hadoop.hbase.filter.FilterList in project cxf by apache.
the class HBaseQueryVisitor method createCompositeQuery.
private Filter createCompositeQuery(List<Filter> queries, boolean orCondition) {
FilterList.Operator oper = orCondition ? FilterList.Operator.MUST_PASS_ONE : FilterList.Operator.MUST_PASS_ALL;
FilterList list = new FilterList(oper);
for (Filter query : queries) {
list.addFilter(query);
}
return list;
}
use of org.apache.hadoop.hbase.filter.FilterList 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;
}
Aggregations