@InterfaceAudience.Public public abstract class CompareFilter extends FilterBase
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
.
Modifier and Type | Class and Description |
---|---|
static class |
CompareFilter.CompareOp
Deprecated.
since 2.0.0. Will be removed in 3.0.0. Use
CompareOperator instead. |
Filter.ReturnCode
Modifier and Type | Field and Description |
---|---|
protected ByteArrayComparable |
comparator |
protected CompareOperator |
op |
Constructor and Description |
---|
CompareFilter(CompareFilter.CompareOp compareOp,
ByteArrayComparable comparator)
Deprecated.
Since 2.0.0. Will be removed in 3.0.0. Use other constructor.
|
CompareFilter(CompareOperator op,
ByteArrayComparable comparator)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
areSerializedFieldsEqual(Filter o)
Default implementation so that writers of custom filters aren't forced to implement.
|
(package private) static boolean |
compare(CompareFilter.CompareOp op,
int compareResult) |
(package private) static boolean |
compare(CompareOperator op,
int compareResult) |
protected boolean |
compareFamily(CompareFilter.CompareOp compareOp,
ByteArrayComparable comparator,
Cell cell)
Deprecated.
Since 2.0.0. Will be removed in 3.0.0.
Use
compareFamily(CompareOperator, ByteArrayComparable, Cell) |
protected boolean |
compareFamily(CompareOperator op,
ByteArrayComparable comparator,
Cell cell) |
protected boolean |
compareQualifier(CompareFilter.CompareOp compareOp,
ByteArrayComparable comparator,
Cell cell)
Deprecated.
Since 2.0.0. Will be removed in 3.0.0.
Use
compareQualifier(CompareOperator, ByteArrayComparable, Cell) |
protected boolean |
compareQualifier(CompareOperator op,
ByteArrayComparable comparator,
Cell cell) |
protected boolean |
compareRow(CompareFilter.CompareOp compareOp,
ByteArrayComparable comparator,
Cell cell)
Deprecated.
Since 2.0.0. Will be removed in 3.0.0.
Use
compareRow(CompareOperator, ByteArrayComparable, Cell) |
protected boolean |
compareRow(CompareOperator op,
ByteArrayComparable comparator,
Cell cell) |
protected boolean |
compareValue(CompareFilter.CompareOp compareOp,
ByteArrayComparable comparator,
Cell cell)
Deprecated.
Since 2.0.0. Will be removed in 3.0.0.
Use
compareValue(CompareOperator, ByteArrayComparable, Cell) |
protected boolean |
compareValue(CompareOperator op,
ByteArrayComparable comparator,
Cell cell) |
(package private) org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos.CompareFilter |
convert() |
boolean |
equals(Object obj) |
static ArrayList<Object> |
extractArguments(ArrayList<byte[]> filterArguments) |
boolean |
filterRowKey(Cell cell)
Filters a row based on the row key.
|
ByteArrayComparable |
getComparator() |
CompareOperator |
getCompareOperator() |
CompareFilter.CompareOp |
getOperator()
Deprecated.
since 2.0.0. Will be removed in 3.0.0. Use
getCompareOperator() instead. |
int |
hashCode() |
String |
toString()
Return filter's info for debugging and logging purpose.
|
createFilterFromArguments, filterAllRemaining, filterRow, filterRowCells, filterRowKey, getNextCellHint, hasFilterRow, isFamilyEssential, reset, toByteArray, transformCell
filterCell, filterKeyValue, isReversed, parseFrom, setReversed
protected CompareOperator op
protected ByteArrayComparable comparator
@Deprecated public CompareFilter(CompareFilter.CompareOp compareOp, ByteArrayComparable comparator)
compareOp
- the compare op for row matchingcomparator
- the comparator for row matchingpublic CompareFilter(CompareOperator op, ByteArrayComparable comparator)
op
- the compare op for row matchingcomparator
- the comparator for row matching@Deprecated public CompareFilter.CompareOp getOperator()
getCompareOperator()
instead.public CompareOperator getCompareOperator()
public ByteArrayComparable getComparator()
public boolean filterRowKey(Cell cell) throws IOException
Filter
Filter.filterCell(Cell)
below.
If Filter.filterAllRemaining()
returns true, then Filter.filterRowKey(Cell)
should
also return true.
Concrete implementers can signal a failure condition in their code by throwing an
IOException
.filterRowKey
in class FilterBase
cell
- The first cell coming in the new rowIOException
- in case an I/O or an filter specific failure needs to be signaled.@Deprecated protected boolean compareRow(CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Cell cell)
compareRow(CompareOperator, ByteArrayComparable, Cell)
protected boolean compareRow(CompareOperator op, ByteArrayComparable comparator, Cell cell)
@Deprecated protected boolean compareFamily(CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Cell cell)
compareFamily(CompareOperator, ByteArrayComparable, Cell)
protected boolean compareFamily(CompareOperator op, ByteArrayComparable comparator, Cell cell)
@Deprecated protected boolean compareQualifier(CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Cell cell)
compareQualifier(CompareOperator, ByteArrayComparable, Cell)
protected boolean compareQualifier(CompareOperator op, ByteArrayComparable comparator, Cell cell)
@Deprecated protected boolean compareValue(CompareFilter.CompareOp compareOp, ByteArrayComparable comparator, Cell cell)
compareValue(CompareOperator, ByteArrayComparable, Cell)
protected boolean compareValue(CompareOperator op, ByteArrayComparable comparator, Cell cell)
static boolean compare(CompareFilter.CompareOp op, int compareResult)
static boolean compare(CompareOperator op, int compareResult)
public static ArrayList<Object> extractArguments(ArrayList<byte[]> filterArguments)
org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos.CompareFilter convert()
boolean areSerializedFieldsEqual(Filter o)
FilterBase
areSerializedFieldsEqual
in class FilterBase
o
- public String toString()
FilterBase
toString
in class FilterBase
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.