@InterfaceAudience.Public public class ColumnValueFilter extends FilterBase
SingleColumnValueFilter
which returns an entire row
when specified condition is matched, ColumnValueFilter
return the matched cell only.
This filter is used to filter cells based on column and value.
It takes a CompareOperator
operator (<, <=, =, !=, >, >=), and
and a ByteArrayComparable
comparator.
Filter.ReturnCode
Modifier and Type | Field and Description |
---|---|
private boolean |
columnFound |
private ByteArrayComparable |
comparator |
private byte[] |
family |
private CompareOperator |
op |
private byte[] |
qualifier |
Constructor and Description |
---|
ColumnValueFilter(byte[] family,
byte[] qualifier,
CompareOperator op,
byte[] value) |
ColumnValueFilter(byte[] family,
byte[] qualifier,
CompareOperator op,
ByteArrayComparable comparator) |
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.
|
private boolean |
compareValue(CompareOperator op,
ByteArrayComparable comparator,
Cell cell)
This method is used to determine a cell should be included or filtered out.
|
(package private) org.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos.ColumnValueFilter |
convert() |
static Filter |
createFilterFromArguments(ArrayList<byte[]> filterArguments)
Creating this filter by reflection, it is used by
ParseFilter , |
boolean |
equals(Object obj) |
Filter.ReturnCode |
filterCell(Cell c)
A way to filter based on the column family, column qualifier and/or the column value.
|
boolean |
filterRowKey(Cell cell)
Filters a row based on the row key.
|
ByteArrayComparable |
getComparator() |
CompareOperator |
getCompareOperator() |
byte[] |
getFamily() |
byte[] |
getQualifier() |
int |
hashCode() |
boolean |
isFamilyEssential(byte[] name)
By default, we require all scan's column families to be present.
|
static ColumnValueFilter |
parseFrom(byte[] pbBytes)
Parse protobuf bytes to a ColumnValueFilter
|
void |
reset()
Filters that are purely stateless and do nothing in their reset() methods can inherit
this null/empty implementation.
|
byte[] |
toByteArray()
Return length 0 byte array for Filters that don't require special serialization
|
String |
toString()
Return filter's info for debugging and logging purpose.
|
filterAllRemaining, filterRow, filterRowCells, filterRowKey, getNextCellHint, hasFilterRow, transformCell
filterKeyValue, isReversed, setReversed
private final byte[] family
private final byte[] qualifier
private final CompareOperator op
private final ByteArrayComparable comparator
private boolean columnFound
public ColumnValueFilter(byte[] family, byte[] qualifier, CompareOperator op, byte[] value)
public ColumnValueFilter(byte[] family, byte[] qualifier, CompareOperator op, ByteArrayComparable comparator)
public CompareOperator getCompareOperator()
public ByteArrayComparable getComparator()
public byte[] getFamily()
public byte[] getQualifier()
public void reset() throws IOException
FilterBase
IOException
.reset
in class FilterBase
IOException
- in case an I/O or an filter specific failure needs to be signaled.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.public Filter.ReturnCode filterCell(Cell c) throws IOException
Filter
ReturnCode.NEXT_ROW
, it should return
ReturnCode.NEXT_ROW
until Filter.reset()
is called just in case the caller calls
for the next row.
Concrete implementers can signal a failure condition in their code by throwing an
IOException
.filterCell
in class Filter
c
- the Cell in questionIOException
- in case an I/O or an filter specific failure needs to be signaled.Filter.ReturnCode
private boolean compareValue(CompareOperator op, ByteArrayComparable comparator, Cell cell)
op
- one of operators CompareOperator
comparator
- comparator used to compare cells.cell
- cell to be compared.public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
ParseFilter
,filterArguments
- arguments for creating a ColumnValueFilterorg.apache.hadoop.hbase.shaded.protobuf.generated.FilterProtos.ColumnValueFilter convert()
public static ColumnValueFilter parseFrom(byte[] pbBytes) throws DeserializationException
pbBytes
- pbBytesDeserializationException
- deserialization exceptionpublic byte[] toByteArray() throws IOException
FilterBase
toByteArray
in class FilterBase
IOException
- in case an I/O or an filter specific failure needs to be signaled.boolean areSerializedFieldsEqual(Filter o)
FilterBase
areSerializedFieldsEqual
in class FilterBase
public boolean isFamilyEssential(byte[] name) throws IOException
FilterBase
IOException
.isFamilyEssential
in class FilterBase
IOException
- in case an I/O or an filter specific failure needs to be signaled.public String toString()
FilterBase
toString
in class FilterBase
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.