public abstract class FilterBase extends Object implements Filter
Filter.ReturnCode
Constructor and Description |
---|
FilterBase() |
Modifier and Type | Method and Description |
---|---|
static Filter |
createFilterFromArguments(ArrayList<byte[]> filterArguments)
Given the filter's arguments it constructs the filter
|
boolean |
filterAllRemaining()
Filters that never filter all remaining can inherit this implementation that
never stops the filter early.
|
Filter.ReturnCode |
filterKeyValue(KeyValue ignored)
Filters that dont filter by key value can inherit this implementation that
includes all KeyValues.
|
boolean |
filterRow()
Filters that never filter by rows based on previously gathered state from
filterKeyValue(KeyValue) can inherit this implementation that
never filters a row. |
void |
filterRow(List<KeyValue> ignored)
Filters that never filter by modifying the returned List of KeyValues can
inherit this implementation that does nothing.
|
boolean |
filterRowKey(byte[] buffer,
int offset,
int length)
Filters that do not filter by row key can inherit this implementation that
never filters anything.
|
KeyValue |
getNextKeyHint(KeyValue currentKV)
Filters that are not sure which key must be next seeked to, can inherit
this implementation that, by default, returns a null KeyValue.
|
boolean |
hasFilterRow()
Fitlers that never filter by modifying the returned List of KeyValues can
inherit this implementation that does nothing.
|
boolean |
isFamilyEssential(byte[] name)
Check that given column family is essential for filter to check row.
|
static boolean |
isFamilyEssential(Filter filter,
byte[] name)
Check that given column family is essential for filter to check row.
|
void |
reset()
Filters that are purely stateless and do nothing in their reset() methods can inherit
this null/empty implementation.
|
String |
toString()
Return filter's info for debugging and logging purpose.
|
KeyValue |
transform(KeyValue v)
By default no transformation takes place
|
public void reset()
public boolean filterRowKey(byte[] buffer, int offset, int length)
filterRowKey
in interface Filter
buffer
- buffer containing row keyoffset
- offset into buffer where row key startslength
- length of the row keypublic boolean filterAllRemaining()
filterAllRemaining
in interface Filter
public Filter.ReturnCode filterKeyValue(KeyValue ignored)
filterKeyValue
in interface Filter
ignored
- the KeyValue in questionFilter.ReturnCode
public KeyValue transform(KeyValue v)
transform
in interface Filter
v
- the KeyValue in questionThe 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 void filterRow(List<KeyValue> ignored)
public boolean hasFilterRow()
hasFilterRow
in interface Filter
public boolean filterRow()
filterKeyValue(KeyValue)
can inherit this implementation that
never filters a row.public KeyValue getNextKeyHint(KeyValue currentKV)
getNextKeyHint
in interface Filter
public boolean isFamilyEssential(byte[] name)
public static boolean isFamilyEssential(Filter filter, byte[] name)
filter
- name
- column family namepublic static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
filterArguments
- the filter's argumentsCopyright © 2014 The Apache Software Foundation. All Rights Reserved.