|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.filter.FilterList
public class FilterList
Implementation of Filter
that represents an ordered List of Filters
which will be evaluated with a specified boolean operator FilterList.Operator.MUST_PASS_ALL
(!AND
) or FilterList.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 FilterList.Operator.MUST_PASS_ALL
.
TODO: Fix creation of Configuration on serialization and deserialization.
Nested Class Summary | |
---|---|
static class |
FilterList.Operator
set operator |
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter |
---|
Filter.ReturnCode |
Constructor Summary | |
---|---|
FilterList()
Default constructor, filters nothing. |
|
FilterList(FilterList.Operator operator)
Constructor that takes an operator. |
|
FilterList(FilterList.Operator operator,
List<Filter> rowFilters)
Constructor that takes a set of Filter s and an operator. |
|
FilterList(List<Filter> rowFilters)
Constructor that takes a set of Filter s. |
Method Summary | |
---|---|
void |
addFilter(Filter filter)
Add a filter. |
boolean |
filterAllRemaining()
If this returns true, the scan will terminate. |
Filter.ReturnCode |
filterKeyValue(KeyValue v)
A way to filter based on the column family, column qualifier and/or the column value. |
boolean |
filterRow()
Last chance to veto row based on previous Filter.filterKeyValue(KeyValue)
calls. |
void |
filterRow(List<KeyValue> kvs)
Chance to alter the list of keyvalues to be submitted. |
boolean |
filterRowKey(byte[] rowKey,
int offset,
int length)
Filters a row based on the row key. |
List<Filter> |
getFilters()
Get the filters. |
KeyValue |
getNextKeyHint(KeyValue currentKV)
If the filter returns the match code SEEK_NEXT_USING_HINT, then it should also tell which is the next key it must seek to. |
FilterList.Operator |
getOperator()
Get the operator. |
boolean |
hasFilterRow()
|
void |
readFields(DataInput in)
|
void |
reset()
Reset the state of the filter between rows. |
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilterList()
public FilterList(List<Filter> rowFilters)
Filter
s. The default operator
MUST_PASS_ALL is assumed.
rowFilters
- list of filterspublic FilterList(FilterList.Operator operator)
operator
- Operator to process filter set with.public FilterList(FilterList.Operator operator, List<Filter> rowFilters)
Filter
s and an operator.
operator
- Operator to process filter set with.rowFilters
- Set of row filters.Method Detail |
---|
public FilterList.Operator getOperator()
public List<Filter> getFilters()
public void addFilter(Filter filter)
filter
- another filterpublic void reset()
Filter
reset
in interface Filter
public boolean filterRowKey(byte[] rowKey, int offset, int length)
Filter
Filter.filterKeyValue(KeyValue)
below.
filterRowKey
in interface Filter
rowKey
- buffer containing row keyoffset
- offset into buffer where row key startslength
- length of the row key
public boolean filterAllRemaining()
Filter
filterAllRemaining
in interface Filter
public Filter.ReturnCode filterKeyValue(KeyValue v)
Filter
ReturnCode.NEXT_ROW
, it should return
ReturnCode.NEXT_ROW
until Filter.reset()
is called
just in case the caller calls for the next row.
filterKeyValue
in interface Filter
v
- the KeyValue in question
Filter.ReturnCode
public void filterRow(List<KeyValue> kvs)
Filter
filterRow
in interface Filter
kvs
- the list of keyvalues to be filteredpublic boolean hasFilterRow()
hasFilterRow
in interface Filter
public boolean filterRow()
Filter
Filter.filterKeyValue(KeyValue)
calls. The filter needs to retain state then return a particular value for
this call if they wish to exclude a row if a certain column is missing
(for example).
filterRow
in interface Filter
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public KeyValue getNextKeyHint(KeyValue currentKV)
Filter
getNextKeyHint
in interface Filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |