org.apache.hadoop.hbase.filter
Interface RowFilterInterface

All Superinterfaces:
Writable
All Known Implementing Classes:
PageRowFilter, RegExpRowFilter, RowFilterSet

public interface RowFilterInterface
extends Writable

Interface used for row-level filters applied to HRegion.HScanner scan results during calls to next().


Method Summary
 void acceptedRow(Text key)
          Called to let filter know that the specified row has been included in the results (passed all filtering).
 boolean filter(Text rowKey)
          Filters on just a row key.
 boolean filter(Text rowKey, Text colKey, byte[] data)
          Filters on row key and/or a column key.
 boolean filterAllRemaining()
          Determines if the filter has decided that all remaining results should be filtered (skipped).
 boolean filterNotNull(TreeMap<Text,byte[]> columns)
          Filters row if given columns are non-null and have null criteria or if there exists criteria on columns not included in the column set.
 void reset()
          Resets the state of the filter.
 void validate(Text[] columns)
          Validates that this filter applies only to a subset of the given columns.
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 

Method Detail

reset

void reset()
Resets the state of the filter. Used prior to the start of a Region scan.


acceptedRow

void acceptedRow(Text key)
Called to let filter know that the specified row has been included in the results (passed all filtering). With out HScanner calling this, the filter does not know if a row passed filtering even if it passed the row itself because other filters may have failed the row. E.g. when this filter is a member of a RowFilterSet with an OR operator.

Parameters:
key -
See Also:
RowFilterSet

filterAllRemaining

boolean filterAllRemaining()
Determines if the filter has decided that all remaining results should be filtered (skipped). This is used to prevent the scanner from scanning a the rest of the HRegion when for sure the filter will exclude all remaining rows.

Returns:
true if the filter intends to filter all remaining rows.

filter

boolean filter(Text rowKey)
Filters on just a row key.

Parameters:
rowKey -
Returns:
true if given row key is filtered and row should not be processed.

filter

boolean filter(Text rowKey,
               Text colKey,
               byte[] data)
Filters on row key and/or a column key.

Parameters:
rowKey - row key to filter on. May be null for no filtering of row key.
colKey - column whose data will be filtered
data - column value
Returns:
true if row filtered and should not be processed.

filterNotNull

boolean filterNotNull(TreeMap<Text,byte[]> columns)
Filters row if given columns are non-null and have null criteria or if there exists criteria on columns not included in the column set. A column is considered null if it:

Parameters:
columns -
Returns:
true if null/non-null criteria not met.

validate

void validate(Text[] columns)
Validates that this filter applies only to a subset of the given columns. This check is done prior to opening of scanner due to the limitation that filtering of columns is dependent on the retrieval of those columns within the HRegion. Criteria on columns that are not part of a scanner's column list will be ignored. In the case of null value filters, all rows will pass the filter. This behavior should be 'undefined' for the user and therefore not permitted.

Parameters:
columns -


Copyright © 2006 The Apache Software Foundation