org.apache.hadoop.hbase.hbql.filter
Class RecordFilterList

java.lang.Object
  extended by org.apache.hadoop.hbase.hbql.filter.RecordFilterList
All Implemented Interfaces:
org.apache.hadoop.hbase.filter.Filter, org.apache.hadoop.io.Writable

public class RecordFilterList
extends Object
implements org.apache.hadoop.hbase.filter.Filter

Implementation of Filter that represents an ordered List of Filters which will be evaluated with a specified boolean operator RecordFilterList.Operator.MUST_PASS_ALL (!AND) or RecordFilterList.Operator.MUST_PASS_ONE (!OR). Since you can use Filter Lists as children of Filter Lists, you can create a hierarchy of filters to be evaluated. Defaults to RecordFilterList.Operator.MUST_PASS_ALL.

TODO: Fix creation of Configuration on serialization and deserialization.


Nested Class Summary
static class RecordFilterList.Operator
          set operator
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.Filter.ReturnCode
 
Constructor Summary
RecordFilterList()
          Default constructor, filters nothing.
RecordFilterList(List<org.apache.hadoop.hbase.filter.Filter> rowFilters)
          Constructor that takes a set of Filters.
RecordFilterList(RecordFilterList.Operator operator)
          Constructor that takes an operator.
RecordFilterList(RecordFilterList.Operator operator, List<org.apache.hadoop.hbase.filter.Filter> rowFilters)
          Constructor that takes a set of Filters and an operator.
 
Method Summary
 void addFilter(org.apache.hadoop.hbase.filter.Filter filter)
          Add a filter.
 boolean filterAllRemaining()
           
 org.apache.hadoop.hbase.filter.Filter.ReturnCode filterKeyValue(org.apache.hadoop.hbase.KeyValue v)
           
 boolean filterRow()
           
 boolean filterRowKey(byte[] rowKey, int offset, int length)
           
 List<org.apache.hadoop.hbase.filter.Filter> getFilters()
          Get the filters.
 RecordFilterList.Operator getOperator()
          Get the operator.
 void readFields(DataInput in)
           
 void reset()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordFilterList

public RecordFilterList()
Default constructor, filters nothing. Required though for RPC deserialization.


RecordFilterList

public RecordFilterList(List<org.apache.hadoop.hbase.filter.Filter> rowFilters)
Constructor that takes a set of Filters. The default operator MUST_PASS_ALL is assumed.

Parameters:
rowFilters -

RecordFilterList

public RecordFilterList(RecordFilterList.Operator operator)
Constructor that takes an operator.

Parameters:
operator - Operator to process filter set with.

RecordFilterList

public RecordFilterList(RecordFilterList.Operator operator,
                        List<org.apache.hadoop.hbase.filter.Filter> rowFilters)
Constructor that takes a set of Filters and an operator.

Parameters:
operator - Operator to process filter set with.
rowFilters - Set of row filters.
Method Detail

getOperator

public RecordFilterList.Operator getOperator()
Get the operator.

Returns:
operator

getFilters

public List<org.apache.hadoop.hbase.filter.Filter> getFilters()
Get the filters.

Returns:
filters

addFilter

public void addFilter(org.apache.hadoop.hbase.filter.Filter filter)
Add a filter.

Parameters:
filter -

reset

public void reset()
Specified by:
reset in interface org.apache.hadoop.hbase.filter.Filter

filterRowKey

public boolean filterRowKey(byte[] rowKey,
                            int offset,
                            int length)
Specified by:
filterRowKey in interface org.apache.hadoop.hbase.filter.Filter

filterAllRemaining

public boolean filterAllRemaining()
Specified by:
filterAllRemaining in interface org.apache.hadoop.hbase.filter.Filter

filterKeyValue

public org.apache.hadoop.hbase.filter.Filter.ReturnCode filterKeyValue(org.apache.hadoop.hbase.KeyValue v)
Specified by:
filterKeyValue in interface org.apache.hadoop.hbase.filter.Filter

filterRow

public boolean filterRow()
Specified by:
filterRow in interface org.apache.hadoop.hbase.filter.Filter

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException


Copyright © 2010. All Rights Reserved.