org.apache.hadoop.hbase.filter
Class WhileMatchFilter

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.FilterBase
      extended by org.apache.hadoop.hbase.filter.WhileMatchFilter
All Implemented Interfaces:
Filter, org.apache.hadoop.io.Writable

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.KeyValue), Filter.filterRow() or Filter.filterAllRemaining() methods returns true.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Constructor Summary
WhileMatchFilter()
           
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(KeyValue v)
          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 FilterBase.filterKeyValue(KeyValue) 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 isFamilyEssential(byte[] name)
          Check that given column family is essential for filter to check row.
 void readFields(DataInput in)
           
 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
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
createFilterFromArguments, filterRow, getNextKeyHint, hasFilterRow, isFamilyEssential
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WhileMatchFilter

public WhileMatchFilter()

WhileMatchFilter

public WhileMatchFilter(Filter filter)
Method Detail

getFilter

public Filter getFilter()

reset

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

Specified by:
reset in interface Filter
Overrides:
reset in class FilterBase

filterAllRemaining

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

Specified by:
filterAllRemaining in interface Filter
Overrides:
filterAllRemaining in class FilterBase
Returns:
true to end scan, false to continue.

filterRowKey

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

Specified by:
filterRowKey in interface Filter
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).

filterKeyValue

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

Specified by:
filterKeyValue in interface Filter
Overrides:
filterKeyValue in class FilterBase
Parameters:
v - the KeyValue in question
Returns:
code as described below
See Also:
Filter.ReturnCode

transform

public KeyValue transform(KeyValue v)
Description copied from class: FilterBase
By default no transformation takes place

Specified by:
transform in interface Filter
Overrides:
transform in class FilterBase
Parameters:
v - the KeyValue in question
Returns:
the changed KeyValue
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.

filterRow

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

Specified by:
filterRow in interface Filter
Overrides:
filterRow in class FilterBase
Returns:
true to exclude row, false to include row.

write

public void write(DataOutput out)
           throws IOException
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Throws:
IOException

isFamilyEssential

public boolean isFamilyEssential(byte[] name)
Description copied from class: FilterBase
Check that given column family is essential for filter to check row. Most filters always return true here. But some could have more sophisticated logic which could significantly reduce scanning process by not even touching columns until we are 100% sure that it's data is needed in result. By default, we require all scan's column families to be present. Our subclasses may be more precise.

Overrides:
isFamilyEssential in class FilterBase

toString

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

Overrides:
toString in class FilterBase


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.