|
||||||||||
| 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,
java.util.List<Filter> rowFilters)
Constructor that takes a set of Filters and an operator. |
|
FilterList(java.util.List<Filter> rowFilters)
Constructor that takes a set of Filters. |
|
| 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(java.util.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. |
java.util.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(java.io.DataInput in)
|
void |
reset()
Reset the state of the filter between rows. |
void |
write(java.io.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(java.util.List<Filter> rowFilters)
Filters. 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,
java.util.List<Filter> rowFilters)
Filters and an operator.
operator - Operator to process filter set with.rowFilters - Set of row filters.| Method Detail |
|---|
public FilterList.Operator getOperator()
public java.util.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)
FilterFilter.filterKeyValue(KeyValue) below.
filterRowKey in interface FilterrowKey - buffer containing row keyoffset - offset into buffer where row key startslength - length of the row key
public boolean filterAllRemaining()
Filter
filterAllRemaining in interface Filterpublic Filter.ReturnCode filterKeyValue(KeyValue v)
FilterReturnCode.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 Filterv - the KeyValue in question
Filter.ReturnCodepublic void filterRow(java.util.List<KeyValue> kvs)
Filter
filterRow in interface Filterkvs - the list of keyvalues to be filteredpublic boolean hasFilterRow()
hasFilterRow in interface Filterpublic boolean filterRow()
FilterFilter.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(java.io.DataInput in)
throws java.io.IOException
readFields in interface org.apache.hadoop.io.Writablejava.io.IOException
public void write(java.io.DataOutput out)
throws java.io.IOException
write in interface org.apache.hadoop.io.Writablejava.io.IOExceptionpublic 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 | |||||||||