org.apache.hadoop.hbase.filter
Class ValueFilter

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

public class ValueFilter
extends CompareFilter

This filter is used to filter based on column value. It takes an operator (equal, greater, not equal, etc) and a byte [] comparator for the cell value.

This filter can be wrapped with WhileMatchFilter and SkipFilter to add more control.

Multiple filters can be combined using FilterList.

To test the value of a single qualifier when scanning multiple qualifiers, use SingleColumnValueFilter.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.CompareFilter
CompareFilter.CompareOp
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.filter.CompareFilter
comparator, compareOp
 
Constructor Summary
ValueFilter()
          Writable constructor, do not use.
ValueFilter(CompareFilter.CompareOp valueCompareOp, WritableByteArrayComparable valueComparator)
          Constructor.
 
Method Summary
 Filter.ReturnCode filterKeyValue(KeyValue v)
          A way to filter based on the column family, column qualifier and/or the column value.
 
Methods inherited from class org.apache.hadoop.hbase.filter.CompareFilter
doCompare, filterAllRemaining, filterRow, filterRowKey, getComparator, getOperator, readFields, reset, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueFilter

public ValueFilter()
Writable constructor, do not use.


ValueFilter

public ValueFilter(CompareFilter.CompareOp valueCompareOp,
                   WritableByteArrayComparable valueComparator)
Constructor.

Parameters:
valueCompareOp - the compare op for column qualifier matching
valueComparator - the comparator for column qualifier matching
Method Detail

filterKeyValue

public Filter.ReturnCode filterKeyValue(KeyValue v)
Description copied from interface: Filter
A way to filter based on the column family, column qualifier and/or the column value. Return code is described below. This allows filters to filter only certain number of columns, then terminate without matching ever column. If your filter returns ReturnCode.NEXT_ROW, it should return ReturnCode.NEXT_ROW until Filter.reset() is called just in case the caller calls for the next row.

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


Copyright © 2010 The Apache Software Foundation