public class DependentColumnFilter extends CompareFilter
CompareFilter.CompareOp
Filter.ReturnCode
Modifier and Type | Field and Description |
---|---|
protected byte[] |
columnFamily |
protected byte[] |
columnQualifier |
protected boolean |
dropDependentColumn |
protected Set<Long> |
stampSet |
comparator, compareOp
Constructor and Description |
---|
DependentColumnFilter()
Should only be used for writable
|
DependentColumnFilter(byte[] family,
byte[] qualifier)
Constructor for DependentColumn filter.
|
DependentColumnFilter(byte[] family,
byte[] qualifier,
boolean dropDependentColumn)
Constructor for DependentColumn filter.
|
DependentColumnFilter(byte[] family,
byte[] qualifier,
boolean dropDependentColumn,
CompareFilter.CompareOp valueCompareOp,
WritableByteArrayComparable valueComparator)
Build a dependent column filter with value checking
dependent column varies will be compared using the supplied
compareOp and comparator, for usage of which
refer to
CompareFilter |
Modifier and Type | Method and Description |
---|---|
static Filter |
createFilterFromArguments(ArrayList<byte[]> filterArguments) |
boolean |
dropDependentColumn() |
boolean |
filterAllRemaining()
Filters that never filter all remaining can inherit this implementation that
never stops the filter early.
|
Filter.ReturnCode |
filterKeyValue(KeyValue v)
Filters that dont filter by key value can inherit this implementation that
includes all KeyValues.
|
boolean |
filterRow()
Filters that never filter by rows based on previously gathered state from
FilterBase.filterKeyValue(KeyValue) can inherit this implementation that
never filters a row. |
void |
filterRow(List<KeyValue> kvs)
Filters that never filter by modifying the returned List of KeyValues can
inherit this implementation that does nothing.
|
boolean |
filterRowKey(byte[] buffer,
int offset,
int length)
Filters that do not filter by row key can inherit this implementation that
never filters anything.
|
boolean |
getDropDependentColumn() |
byte[] |
getFamily() |
byte[] |
getQualifier() |
boolean |
hasFilterRow()
Fitlers that never filter by modifying the returned List of KeyValues can
inherit this implementation that does nothing.
|
void |
readFields(DataInput in) |
void |
reset()
Filters that are purely stateless and do nothing in their reset() methods can inherit
this null/empty implementation.
|
String |
toString()
Return filter's info for debugging and logging purpose.
|
void |
write(DataOutput out) |
doCompare, extractArguments, getComparator, getOperator
getNextKeyHint, isFamilyEssential, isFamilyEssential, transform
protected byte[] columnFamily
protected byte[] columnQualifier
protected boolean dropDependentColumn
public DependentColumnFilter()
public DependentColumnFilter(byte[] family, byte[] qualifier, boolean dropDependentColumn, CompareFilter.CompareOp valueCompareOp, WritableByteArrayComparable valueComparator)
CompareFilter
family
- dependent column familyqualifier
- dependent column qualifierdropDependentColumn
- whether the column should be discarded aftervalueCompareOp
- comparison opvalueComparator
- comparatorpublic DependentColumnFilter(byte[] family, byte[] qualifier)
family
- name of target column familyqualifier
- name of column qualifierpublic DependentColumnFilter(byte[] family, byte[] qualifier, boolean dropDependentColumn)
family
- name of dependent column familyqualifier
- name of dependent qualifierdropDependentColumn
- whether the dependent columns keyvalues should be discardedpublic byte[] getFamily()
public byte[] getQualifier()
public boolean dropDependentColumn()
public boolean getDropDependentColumn()
public boolean filterAllRemaining()
FilterBase
filterAllRemaining
in interface Filter
filterAllRemaining
in class FilterBase
public Filter.ReturnCode filterKeyValue(KeyValue v)
FilterBase
filterKeyValue
in interface Filter
filterKeyValue
in class FilterBase
v
- the KeyValue in questionFilter.ReturnCode
public void filterRow(List<KeyValue> kvs)
FilterBase
filterRow
in interface Filter
filterRow
in class FilterBase
kvs
- the list of keyvalues to be filteredpublic boolean hasFilterRow()
FilterBase
hasFilterRow
in interface Filter
hasFilterRow
in class FilterBase
public boolean filterRow()
FilterBase
FilterBase.filterKeyValue(KeyValue)
can inherit this implementation that
never filters a row.filterRow
in interface Filter
filterRow
in class FilterBase
public boolean filterRowKey(byte[] buffer, int offset, int length)
FilterBase
filterRowKey
in interface Filter
filterRowKey
in class FilterBase
buffer
- buffer containing row keyoffset
- offset into buffer where row key startslength
- length of the row keypublic void reset()
FilterBase
reset
in interface Filter
reset
in class FilterBase
public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class CompareFilter
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class CompareFilter
IOException
public String toString()
FilterBase
toString
in class CompareFilter
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.