Package org.apache.hadoop.hbase.filter
Class CompareFilter
java.lang.Object
org.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.CompareFilter
- Direct Known Subclasses:
DependentColumnFilter,FamilyFilter,QualifierFilter,RowFilter,ValueFilter
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 family, use FamilyFilter.
To filter by column qualifier, use QualifierFilter.
To filter by value, use ValueFilter.
These filters can be wrapped with SkipFilter and WhileMatchFilter to add more
control.
Multiple filters can be combined using FilterList.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCompareFilter(CompareOperator op, ByteArrayComparable comparator) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) booleanReturns true if and only if the fields of the filter that are serialized are equal to the corresponding fields in other.(package private) static booleancompare(CompareOperator op, int compareResult) protected booleancompareFamily(CompareOperator op, ByteArrayComparable comparator, Cell cell) protected booleancompareQualifier(CompareOperator op, ByteArrayComparable comparator, Cell cell) protected booleancompareRow(CompareOperator op, ByteArrayComparable comparator, Cell cell) protected booleancompareValue(CompareOperator op, ByteArrayComparable comparator, Cell cell) (package private) org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos.CompareFilterconvert()Returns A pb instance to represent this instance.booleanextractArguments(ArrayList<byte[]> filterArguments) Returns an array of heterogeneous objectsbooleanfilterRowKey(Cell cell) Filters a row based on the row key.Returns the comparatorinthashCode()toString()Return filter's info for debugging and logging purpose.Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
createFilterFromArguments, filterAllRemaining, filterRow, filterRowCells, getNextCellHint, hasFilterRow, isFamilyEssential, reset, toByteArray, transformCellMethods inherited from class org.apache.hadoop.hbase.filter.Filter
filterCell, isReversed, parseFrom, setReversed
-
Field Details
-
op
-
comparator
-
-
Constructor Details
-
CompareFilter
Constructor.- Parameters:
op- the compare op for row matchingcomparator- the comparator for row matching
-
-
Method Details
-
getCompareOperator
-
getComparator
Returns the comparator -
filterRowKey
Description copied from class:FilterFilters a row based on the row key. If this returns true, the entire row will be excluded. If false, each KeyValue in the row will be passed toFilter.filterCell(Cell)below. IfFilter.filterAllRemaining()returns true, thenFilter.filterRowKey(Cell)should also return true. Concrete implementers can signal a failure condition in their code by throwing anIOException.- Overrides:
filterRowKeyin classFilterBase- Parameters:
cell- The first cell coming in the new row- Returns:
- true, remove entire row, false, include the row (maybe).
- Throws:
IOException- in case an I/O or an filter specific failure needs to be signaled.
-
compareRow
-
compareFamily
-
compareQualifier
-
compareValue
-
compare
-
extractArguments
Returns an array of heterogeneous objects -
convert
org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos.CompareFilter convert()Returns A pb instance to represent this instance. -
areSerializedFieldsEqual
Returns true if and only if the fields of the filter that are serialized are equal to the corresponding fields in other. Used for testing.- Overrides:
areSerializedFieldsEqualin classFilterBase- Returns:
- true if and only if the fields of the filter that are serialized are equal to the corresponding fields in other. Used for testing.
-
toString
Description copied from class:FilterBaseReturn filter's info for debugging and logging purpose.- Overrides:
toStringin classFilterBase
-
equals
-
hashCode
-