|
||||||||||
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.FilterWrapper
@InterfaceAudience.Private public final class FilterWrapper
This is a Filter wrapper class which is used in the server side. Some filter
related hooks can be defined in this wrapper. The only way to create a
FilterWrapper instance is passing a client side Filter instance through
Scan.getFilter()
.
Nested Class Summary | |
---|---|
static class |
FilterWrapper.FilterRowRetCode
|
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 | |
---|---|
FilterWrapper(Filter filter)
|
Method Summary | |
---|---|
boolean |
filterAllRemaining()
If this returns true, the scan will terminate. |
Filter.ReturnCode |
filterKeyValue(Cell 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(Cell) calls. |
void |
filterRow(List<KeyValue> kvs)
Deprecated. |
void |
filterRowCells(List<Cell> kvs)
Chance to alter the list of Cells to be submitted. |
FilterWrapper.FilterRowRetCode |
filterRowCellsWithRet(List<Cell> kvs)
|
boolean |
filterRowKey(byte[] buffer,
int offset,
int length)
Filters a row based on the row key. |
Cell |
getNextCellHint(Cell currentKV)
Old filter wrapper descendants will implement KV getNextKeyHint(KV) so we should call it. |
KeyValue |
getNextKeyHint(KeyValue currentKV)
Deprecated. |
boolean |
hasFilterRow()
Primarily used to check for conflicts with scans(such as scans that do not read a full row at a time). |
boolean |
isFamilyEssential(byte[] name)
Check that given column family is essential for filter to check row. |
static FilterWrapper |
parseFrom(byte[] pbBytes)
|
void |
reset()
Reset the state of the filter between rows. |
byte[] |
toByteArray()
TODO: JAVADOC Concrete implementers can signal a failure condition in their code by throwing an IOException . |
KeyValue |
transform(KeyValue currentKV)
Deprecated. |
Cell |
transformCell(Cell v)
Give the filter a chance to transform the passed KeyValue. |
Methods inherited from class org.apache.hadoop.hbase.filter.Filter |
---|
isReversed, setReversed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilterWrapper(Filter filter)
Method Detail |
---|
public byte[] toByteArray() throws IOException
Filter
IOException
.
toByteArray
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.public static FilterWrapper parseFrom(byte[] pbBytes) throws DeserializationException
pbBytes
- A pb serialized FilterWrapper
instance
FilterWrapper
made from bytes
DeserializationException
toByteArray()
public void reset() throws IOException
Filter
IOException
.
reset
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.public boolean filterAllRemaining() throws IOException
Filter
IOException
.
filterAllRemaining
in class Filter
IOException
- in case an I/O or an filter specific failure needs to be signaled.public boolean filterRow() throws IOException
Filter
Filter.filterKeyValue(Cell)
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).
Concrete implementers can signal a failure condition in their code by throwing an
IOException
.
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 filterRowKey(byte[] buffer, int offset, int length) throws IOException
Filter
Filter.filterKeyValue(Cell)
below.
Concrete implementers can signal a failure condition in their code by throwing an
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 Filter.ReturnCode filterKeyValue(Cell v) throws IOException
Filter
ReturnCode.NEXT_ROW
, it should return
ReturnCode.NEXT_ROW
until Filter.reset()
is called just in case the caller calls
for the next row.
Concrete implementers can signal a failure condition in their code by throwing an
IOException
.
filterKeyValue
in class Filter
v
- 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
Filter
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 boolean hasFilterRow()
Filter
hasFilterRow
in class Filter
public void filterRowCells(List<Cell> kvs) throws IOException
Filter
IOException
.
filterRowCells
in class Filter
kvs
- the list of Cells to be filtered
IOException
- in case an I/O or an filter specific failure needs to be signaled.public FilterWrapper.FilterRowRetCode filterRowCellsWithRet(List<Cell> kvs) throws IOException
IOException
@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 isFamilyEssential(byte[] name) throws IOException
Filter
IOException
.
isFamilyEssential
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 |