|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Filter
Interface for row and column filters directly applied within the regionserver. A filter can expect the following call sequence:
reset()filterAllRemaining() -> true indicates scan is over, false, keep going on.filterRowKey(byte[],int,int) -> true to drop this row,
if false, we will also callfilterKeyValue(KeyValue) -> true to drop this key/valuefilterRow(List) -> allows directmodification of the final list to be submitted
filterRow() -> last chance to drop entire row based on the sequence of
filterValue() calls. Eg: filter a row if it doesn't contain a specified column.
FilterBase to help
you reduce boilerplate.
FilterBase| Nested Class Summary | |
|---|---|
static class |
Filter.ReturnCode
Return codes for filterValue(). |
| Method Summary | |
|---|---|
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 filterKeyValue(KeyValue)
calls. |
void |
filterRow(List<KeyValue> kvs)
Chance to alter the list of keyvalues to be submitted. |
boolean |
filterRowKey(byte[] buffer,
int offset,
int length)
Filters a row based on the row key. |
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. |
boolean |
hasFilterRow()
Return whether or not this filter actively uses filterRow(List) Primarily used to check for conflicts with scans(such as scans that do not read a full row at a time) |
void |
reset()
Reset the state of the filter between rows. |
| Methods inherited from interface org.apache.hadoop.io.Writable |
|---|
readFields, write |
| Method Detail |
|---|
void reset()
boolean filterRowKey(byte[] buffer,
int offset,
int length)
filterKeyValue(KeyValue) below.
buffer - buffer containing row keyoffset - offset into buffer where row key startslength - length of the row key
boolean filterAllRemaining()
Filter.ReturnCode filterKeyValue(KeyValue v)
ReturnCode.NEXT_ROW, it should return
ReturnCode.NEXT_ROW until reset() is called
just in case the caller calls for the next row.
v - the KeyValue in question
Filter.ReturnCodevoid filterRow(List<KeyValue> kvs)
kvs - the list of keyvalues to be filteredboolean hasFilterRow()
boolean filterRow()
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).
KeyValue getNextKeyHint(KeyValue currentKV)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||