org.apache.hadoop.hbase.filter
Class ValueFilter

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.CompareFilter
              extended by org.apache.hadoop.hbase.filter.ValueFilter

@InterfaceAudience.Public
@InterfaceStability.Stable
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 class org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.filter.CompareFilter
comparator, compareOp
 
Fields inherited from class org.apache.hadoop.hbase.filter.Filter
reversed
 
Constructor Summary
ValueFilter(CompareFilter.CompareOp valueCompareOp, ByteArrayComparable valueComparator)
          Constructor.
 
Method Summary
static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
           
 Filter.ReturnCode filterKeyValue(Cell v)
          Filters that dont filter by key value can inherit this implementation that includes all Cells.
static ValueFilter parseFrom(byte[] pbBytes)
           
 byte[] toByteArray()
          Return length 0 byte array for Filters that don't require special serialization
 
Methods inherited from class org.apache.hadoop.hbase.filter.CompareFilter
doCompare, extractArguments, getComparator, getOperator, toString
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterAllRemaining, filterRow, filterRow, filterRowCells, filterRowKey, getNextCellHint, getNextKeyHint, hasFilterRow, isFamilyEssential, reset, transform, transformCell
 
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

ValueFilter

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

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

filterKeyValue

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

Overrides:
filterKeyValue in class org.apache.hadoop.hbase.filter.FilterBase
Parameters:
v - the Cell in question
Returns:
code as described below
See Also:
Filter.ReturnCode

createFilterFromArguments

public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)

toByteArray

public byte[] toByteArray()
Description copied from class: org.apache.hadoop.hbase.filter.FilterBase
Return length 0 byte array for Filters that don't require special serialization

Overrides:
toByteArray in class org.apache.hadoop.hbase.filter.FilterBase
Returns:
The filter serialized using pb

parseFrom

public static ValueFilter parseFrom(byte[] pbBytes)
                             throws org.apache.hadoop.hbase.exceptions.DeserializationException
Parameters:
pbBytes - A pb serialized ValueFilter instance
Returns:
An instance of ValueFilter made from bytes
Throws:
org.apache.hadoop.hbase.exceptions.DeserializationException
See Also:
toByteArray()


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