@InterfaceAudience.Public public class ColumnValueFilter extends org.apache.hadoop.hbase.filter.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
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 |
---|---|
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
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
org.apache.hadoop.hbase.filter.FilterBase
IOException
.reset
in class org.apache.hadoop.hbase.filter.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 org.apache.hadoop.hbase.filter.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
public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
ParseFilter
,filterArguments
- arguments for creating a ColumnValueFilterpublic static ColumnValueFilter parseFrom(byte[] pbBytes) throws org.apache.hadoop.hbase.exceptions.DeserializationException
pbBytes
- pbBytesorg.apache.hadoop.hbase.exceptions.DeserializationException
- deserialization exceptionpublic byte[] toByteArray() throws IOException
org.apache.hadoop.hbase.filter.FilterBase
toByteArray
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
- in case an I/O or an filter specific failure needs to be signaled.public boolean isFamilyEssential(byte[] name) throws IOException
org.apache.hadoop.hbase.filter.FilterBase
IOException
.isFamilyEssential
in class org.apache.hadoop.hbase.filter.FilterBase
IOException
- in case an I/O or an filter specific failure needs to be signaled.public String toString()
org.apache.hadoop.hbase.filter.FilterBase
toString
in class org.apache.hadoop.hbase.filter.FilterBase
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.