org.apache.hadoop.hbase.filter
Class CompareFilter
java.lang.Object
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.CompareFilter
- All Implemented Interfaces:
- Filter, org.apache.hadoop.io.Writable
- Direct Known Subclasses:
- DependentColumnFilter, FamilyFilter, QualifierFilter, RowFilter, ValueFilter
public abstract class CompareFilter
- extends FilterBase
This is a generic filter to be used to filter by comparison. It takes an
operator (equal, greater, not equal, etc) and a byte [] comparator.
To filter by row key, use RowFilter
.
To filter by column qualifier, use QualifierFilter
.
To filter by value, use SingleColumnValueFilter
.
These filters can be wrapped with SkipFilter
and WhileMatchFilter
to add more control.
Multiple filters can be combined using FilterList
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
compareOp
protected CompareFilter.CompareOp compareOp
comparator
protected WritableByteArrayComparable comparator
CompareFilter
public CompareFilter()
- Writable constructor, do not use.
CompareFilter
public CompareFilter(CompareFilter.CompareOp compareOp,
WritableByteArrayComparable comparator)
- Constructor.
- Parameters:
compareOp
- the compare op for row matchingcomparator
- the comparator for row matching
getOperator
public CompareFilter.CompareOp getOperator()
- Returns:
- operator
getComparator
public WritableByteArrayComparable getComparator()
- Returns:
- the comparator
doCompare
protected boolean doCompare(CompareFilter.CompareOp compareOp,
WritableByteArrayComparable comparator,
byte[] data,
int offset,
int length)
readFields
public void readFields(DataInput in)
throws IOException
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Throws:
IOException
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.