|
||||||||||
| 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(Filter... rowFilters)
Constructor that takes a var arg number of Filters. |
|
FilterList(FilterList.Operator operator)
Constructor that takes an operator. |
|
FilterList(FilterList.Operator operator,
Filter... rowFilters)
Constructor that takes a var arg number of Filters and an operator. |
|
FilterList(FilterList.Operator operator,
List<Filter> rowFilters)
Constructor that takes a set of Filters and an operator. |
|
FilterList(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(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. |
KeyValue |
transform(KeyValue v)
Give the filter a chance to transform the passed KeyValue. |
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)
Filters. The default operator
MUST_PASS_ALL is assumed.
rowFilters - list of filterspublic FilterList(Filter... rowFilters)
Filters. The fefault operator
MUST_PASS_ALL is assumed.
rowFilters - public FilterList(FilterList.Operator operator)
operator - Operator to process filter set with.
public FilterList(FilterList.Operator operator,
List<Filter> rowFilters)
Filters and an operator.
operator - Operator to process filter set with.rowFilters - Set of row filters.
public FilterList(FilterList.Operator operator,
Filter... rowFilters)
Filters and an operator.
operator - Operator to process filter set with.rowFilters - Filters to use| 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)
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 KeyValue transform(KeyValue v)
Filter
transform in interface Filterv - the KeyValue in question
The transformed KeyValue is what is eventually returned to the
client. Most filters will return the passed KeyValue unchanged.,
for an example of a transformation.public 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(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(DataInput in)
throws IOException
readFields in interface org.apache.hadoop.io.WritableIOException
public void write(DataOutput out)
throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic 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 | |||||||||