org.apache.hadoop.hbase.filter
Class WhileMatchFilter

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.Filter
      extended by org.apache.hadoop.hbase.filter.FilterBase
          extended by org.apache.hadoop.hbase.filter.WhileMatchFilter

@InterfaceAudience.Public
@InterfaceStability.Stable
public class WhileMatchFilter
extends FilterBase

A wrapper filter that returns true from filterAllRemaining() as soon as the wrapped filters Filter.filterRowKey(byte[], int, int), Filter.filterKeyValue(org.apache.hadoop.hbase.Cell), Filter.filterRow() or Filter.filterAllRemaining() methods returns true.


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
WhileMatchFilter(Filter filter)
           
 
Method Summary
 boolean filterAllRemaining()
          Filters that never filter all remaining can inherit this implementation that never stops the filter early.
 Filter.ReturnCode filterKeyValue(Cell v)
          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 FilterBase.filterKeyValue(Cell) can inherit this implementation that never filters a row.
 boolean filterRowKey(byte[] buffer, int offset, int length)
          Filters that do not filter by row key can inherit this implementation that never filters anything.
 Filter getFilter()
           
 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.
static WhileMatchFilter parseFrom(byte[] pbBytes)
           
 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.
 Cell transformCell(Cell v)
          By default no transformation takes place
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
createFilterFromArguments, filterRow, filterRowCells, getNextCellHint, getNextKeyHint, transform
 
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, wait, wait, wait
 

Constructor Detail

WhileMatchFilter

public WhileMatchFilter(Filter filter)
Method Detail

getFilter

public Filter getFilter()

reset

public void reset()
           throws IOException
Description copied from class: FilterBase
Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation.

Overrides:
reset in class FilterBase
Throws:
IOException - in case an I/O or an filter specific failure needs to be signaled.

filterAllRemaining

public boolean filterAllRemaining()
                           throws IOException
Description copied from class: FilterBase
Filters that never filter all remaining can inherit this implementation that never stops the filter early.

Overrides:
filterAllRemaining in class FilterBase
Returns:
true to end scan, false to continue.
Throws:
IOException - in case an I/O or an filter specific failure needs to be signaled.

filterRowKey

public boolean filterRowKey(byte[] buffer,
                            int offset,
                            int length)
                     throws IOException
Description copied from class: FilterBase
Filters that do not filter by row key can inherit this implementation that never filters anything. (ie: returns false).

Overrides:
filterRowKey in class FilterBase
Parameters:
buffer - buffer containing row key
offset - offset into buffer where row key starts
length - length of the row key
Returns:
true, remove entire row, false, include the row (maybe).
Throws:
IOException - in case an I/O or an filter specific failure needs to be signaled.

filterKeyValue

public Filter.ReturnCode filterKeyValue(Cell v)
                                 throws IOException
Description copied from class: FilterBase
Filters that dont filter by key value can inherit this implementation that includes all Cells.

Overrides:
filterKeyValue in class FilterBase
Parameters:
v - the Cell in question
Returns:
code as described below
Throws:
IOException - in case an I/O or an filter specific failure needs to be signaled.
See Also:
Filter.ReturnCode

transformCell

public Cell transformCell(Cell v)
                   throws IOException
Description copied from class: FilterBase
By default no transformation takes place

Overrides:
transformCell in class FilterBase
Parameters:
v - the KeyValue in question
Returns:
the changed KeyValue
Throws:
IOException - in case an I/O or an filter specific failure needs to be signaled.
See Also:
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}.

filterRow

public boolean filterRow()
                  throws IOException
Description copied from class: FilterBase
Filters that never filter by rows based on previously gathered state from FilterBase.filterKeyValue(Cell) can inherit this implementation that never filters a row.

Overrides:
filterRow in class FilterBase
Returns:
true to exclude row, false to include row.
Throws:
IOException - in case an I/O or an filter specific failure needs to be signaled.

hasFilterRow

public boolean hasFilterRow()
Description copied from class: FilterBase
Fitlers that never filter by modifying the returned List of Cells can inherit this implementation that does nothing.

Overrides:
hasFilterRow in class FilterBase
Returns:
True if this filter actively uses filterRow(List) or filterRow().

toByteArray

public byte[] toByteArray()
                   throws IOException
Description copied from class: FilterBase
Return length 0 byte array for Filters that don't require special serialization

Overrides:
toByteArray in class FilterBase
Returns:
The filter serialized using pb
Throws:
IOException - in case an I/O or an filter specific failure needs to be signaled.

parseFrom

public static WhileMatchFilter parseFrom(byte[] pbBytes)
                                  throws DeserializationException
Parameters:
pbBytes - A pb serialized WhileMatchFilter instance
Returns:
An instance of WhileMatchFilter made from bytes
Throws:
DeserializationException
See Also:
toByteArray()

isFamilyEssential

public boolean isFamilyEssential(byte[] name)
                          throws IOException
Description copied from class: FilterBase
By default, we require all scan's column families to be present. Our subclasses may be more precise.

Overrides:
isFamilyEssential in class FilterBase
Throws:
IOException - in case an I/O or an filter specific failure needs to be signaled.

toString

public String toString()
Description copied from class: FilterBase
Return filter's info for debugging and logging purpose.

Overrides:
toString in class FilterBase


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.