|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.filter.ColumnValueFilter
public class ColumnValueFilter
This filter is used to filter based on the value of a given column. It takes an operator (equal, greater, not equal, etc) and either a byte [] value or a byte [] comparator. If we have a byte [] value then we just do a lexicographic compare. If this is not sufficient (eg you want to deserialize a long and then compare it to a fixed long value, then you can pass in your own comparator instead.
| Nested Class Summary | |
|---|---|
static class |
ColumnValueFilter.CompareOp
Comparison operators. |
| Constructor Summary | |
|---|---|
ColumnValueFilter(byte[] columnName,
ColumnValueFilter.CompareOp compareOp,
byte[] value)
Constructor. |
|
ColumnValueFilter(byte[] columnName,
ColumnValueFilter.CompareOp compareOp,
WritableByteArrayComparable comparator)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
filterAllRemaining()
Determines if the filter has decided that all remaining results should be filtered (skipped). |
boolean |
filterColumn(byte[] rowKey,
byte[] colKey,
byte[] data)
Filters on row key, column name, and column value. |
boolean |
filterRow(SortedMap<byte[],Cell> columns)
Filter on the fully assembled row. |
boolean |
filterRowKey(byte[] rowKey)
Filters on just a row key. |
boolean |
processAlways()
Returns whether or not the filter should always be processed in any filtering call. |
void |
readFields(DataInput in)
|
void |
reset()
Resets the state of the filter. |
void |
rowProcessed(boolean filtered,
byte[] key)
Called to let filter know the final decision (to pass or filter) on a given row. |
void |
validate(byte[][] columns)
Validates that this filter applies only to a subset of the given columns. |
void |
write(DataOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColumnValueFilter(byte[] columnName,
ColumnValueFilter.CompareOp compareOp,
byte[] value)
columnName - name of columncompareOp - operatorvalue - value to compare column values against
public ColumnValueFilter(byte[] columnName,
ColumnValueFilter.CompareOp compareOp,
WritableByteArrayComparable comparator)
columnName - name of columncompareOp - operatorcomparator - Comparator to use.| Method Detail |
|---|
public boolean filterRowKey(byte[] rowKey)
RowFilterInterface
filterRowKey in interface RowFilterInterface
public boolean filterColumn(byte[] rowKey,
byte[] colKey,
byte[] data)
RowFilterInterface
filterColumn in interface RowFilterInterfacerowKey - row key to filter on.colKey - column name to filter ondata - column value to filter on
public boolean filterAllRemaining()
RowFilterInterface
filterAllRemaining in interface RowFilterInterfacepublic boolean filterRow(SortedMap<byte[],Cell> columns)
RowFilterInterface
filterRow in interface RowFilterInterfacepublic boolean processAlways()
RowFilterInterface
processAlways in interface RowFilterInterfacepublic void reset()
RowFilterInterface
reset in interface RowFilterInterface
public void rowProcessed(boolean filtered,
byte[] key)
RowFilterInterface
rowProcessed in interface RowFilterInterfaceRowFilterSetpublic void validate(byte[][] columns)
RowFilterInterface
validate in interface RowFilterInterface
public void readFields(DataInput in)
throws IOException
readFields in interface org.apache.hadoop.io.WritableIOException
public void write(DataOutput out)
throws IOException
write in interface org.apache.hadoop.io.WritableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||