|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.SkipFilter
public class SkipFilter
A wrapper filter that filters an entire row if any of the KeyValue checks do not pass.
For example, if all columns in a row represent weights of different things,
with the values being the actual weights, and we want to filter out the
entire row if any of its weights are zero. In this case, we want to prevent
rows from being emitted if a single key is filtered. Combine this filter
with a ValueFilter:
scan.setFilter(new SkipFilter(new ValueFilter(CompareOp.EQUAL,
new BinaryComparator(Bytes.toBytes(0))));
Any row which contained a column whose value was 0 will be filtered out.
Without this filter, the other non-zero valued columns in the row would still
be emitted.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter |
|---|
Filter.ReturnCode |
| Constructor Summary | |
|---|---|
SkipFilter()
|
|
SkipFilter(Filter filter)
|
|
| Method Summary | |
|---|---|
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. |
Filter |
getFilter()
|
void |
readFields(DataInput in)
|
void |
reset()
Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation. |
KeyValue |
transform(KeyValue v)
By default no transformation takes place |
void |
write(DataOutput out)
|
| Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase |
|---|
createFilterFromArguments, filterAllRemaining, filterRow, filterRowKey, getNextKeyHint, hasFilterRow |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SkipFilter()
public SkipFilter(Filter filter)
| Method Detail |
|---|
public Filter getFilter()
public void reset()
FilterBase
reset in interface Filterreset in class FilterBasepublic Filter.ReturnCode filterKeyValue(KeyValue v)
FilterBase
filterKeyValue in interface FilterfilterKeyValue in class FilterBasev - the KeyValue in question
Filter.ReturnCodepublic KeyValue transform(KeyValue v)
FilterBase
transform in interface Filtertransform in class FilterBasev - the KeyValue in question
The transformed KeyValue is what is eventually returned to the
client. Most filters will return the passed KeyValue unchanged.,
for an example of a transformation.public boolean filterRow()
FilterBaseFilterBase.filterKeyValue(KeyValue) can inherit this implementation that
never filters a row.
filterRow in interface FilterfilterRow in class FilterBase
public void write(DataOutput out)
throws IOException
IOException
public void readFields(DataInput in)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||