|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.FilterBase
@InterfaceAudience.Private public abstract class FilterBase
Abstract base class to help you implement new Filters. Common "ignore" or NOOP type methods can go here, helping to reduce boiler plate in an ever-expanding filter library. If you could instantiate FilterBase, it would end up being a "null" filter - that is one that never filters anything.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter |
---|
Filter.ReturnCode |
Field Summary |
---|
Fields inherited from class org.apache.hadoop.hbase.filter.Filter |
---|
reversed |
Constructor Summary | |
---|---|
FilterBase()
|
Method Summary | |
---|---|
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(Cell ignored)
Filters that dont filter by key value can inherit this implementation that includes all Cells. |
boolean |
filterRow()
Filters that never filter by rows based on previously gathered state from filterKeyValue(Cell) can inherit this implementation that
never filters a row. |
void |
filterRow(List<KeyValue> kvs)
Deprecated. |
void |
filterRowCells(List<Cell> ignored)
Filters that never filter by modifying the returned List of Cells 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. |
Cell |
getNextCellHint(Cell currentKV)
Filters that are not sure which key must be next seeked to, can inherit this implementation that, by default, returns a null Cell. |
KeyValue |
getNextKeyHint(KeyValue currentKV)
Deprecated. |
boolean |
hasFilterRow()
Fitlers that never filter by modifying the returned List of Cells can inherit this implementation that does nothing. |
boolean |
isFamilyEssential(byte[] name)
By default, we require all scan's column families to be present. |
void |
reset()
Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation. |
byte[] |
toByteArray()
Return length 0 byte array for Filters that don't require special serialization |
String |
toString()
Return filter's info for debugging and logging purpose. |
KeyValue |
transform(KeyValue currentKV)
Deprecated. |
Cell |
transformCell(Cell v)
By default no transformation takes place |
Methods inherited from class org.apache.hadoop.hbase.filter.Filter |
---|
isReversed, parseFrom, setReversed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FilterBase()
Method Detail |
---|
public void reset() throws IOException
reset
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.public boolean filterRowKey(byte[] buffer, int offset, int length) throws IOException
filterRowKey
in class Filter
buffer
- buffer containing row keyoffset
- offset into buffer where row key startslength
- length of the row key
IOException
- in case an I/O or an filter specific failure needs to be signaled.public boolean filterAllRemaining() throws IOException
filterAllRemaining
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.public Filter.ReturnCode filterKeyValue(Cell ignored) throws IOException
filterKeyValue
in class Filter
ignored
- the Cell in question
IOException
- in case an I/O or an filter specific failure needs to be signaled.Filter.ReturnCode
public Cell transformCell(Cell v) throws IOException
transformCell
in class Filter
v
- the KeyValue in question
IOException
- in case an I/O or an filter specific failure needs to be signaled.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.
Concrete implementers can signal a failure condition in their code by throwing an
{@link IOException}.
@Deprecated public KeyValue transform(KeyValue currentKV) throws IOException
transformCell(Cell)
.
This is for transition from 0.94 -> 0.96
transform
in class Filter
IOException
public void filterRowCells(List<Cell> ignored) throws IOException
filterRowCells
in class Filter
ignored
- the list of Cells to be filtered
IOException
- in case an I/O or an filter specific failure needs to be signaled.@Deprecated public void filterRow(List<KeyValue> kvs) throws IOException
transformCell(Cell)
.
This is for transition from 0.94 -> 0.96
filterRow
in class Filter
IOException
public boolean hasFilterRow()
hasFilterRow
in class Filter
public boolean filterRow() throws IOException
filterKeyValue(Cell)
can inherit this implementation that
never filters a row.
filterRow
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.@Deprecated public KeyValue getNextKeyHint(KeyValue currentKV) throws IOException
getNextKeyHint
in class Filter
IOException
public Cell getNextCellHint(Cell currentKV) throws IOException
getNextCellHint
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.public boolean isFamilyEssential(byte[] name) throws IOException
isFamilyEssential
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
filterArguments
- the filter's arguments
public String toString()
toString
in class Object
public byte[] toByteArray() throws IOException
toByteArray
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |