org.apache.hadoop.hbase.filter
Class ColumnPrefixFilter
java.lang.Object
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.ColumnPrefixFilter
- All Implemented Interfaces:
- Filter, org.apache.hadoop.io.Writable
public class ColumnPrefixFilter
- extends FilterBase
This filter is used for selecting only those keys with columns that matches
a particular prefix. For example, if prefix is 'an', it will pass keys will
columns like 'and', 'anti' but not keys with columns like 'ball', 'act'.
Field Summary |
protected byte[] |
prefix
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
prefix
protected byte[] prefix
ColumnPrefixFilter
public ColumnPrefixFilter()
ColumnPrefixFilter
public ColumnPrefixFilter(byte[] prefix)
getPrefix
public byte[] getPrefix()
filterKeyValue
public Filter.ReturnCode filterKeyValue(KeyValue kv)
- Description copied from class:
FilterBase
- Filters that dont filter by key value can inherit this implementation that
includes all KeyValues.
- Specified by:
filterKeyValue
in interface Filter
- Overrides:
filterKeyValue
in class FilterBase
- Parameters:
kv
- the KeyValue in question
- Returns:
- code as described below
- See Also:
Filter.ReturnCode
filterColumn
public Filter.ReturnCode filterColumn(byte[] buffer,
int qualifierOffset,
int qualifierLength)
write
public void write(DataOutput out)
throws IOException
- Throws:
IOException
readFields
public void readFields(DataInput in)
throws IOException
- Throws:
IOException
getNextKeyHint
public KeyValue getNextKeyHint(KeyValue kv)
- Description copied from class:
FilterBase
- Filters that are not sure which key must be next seeked to, can inherit
this implementation that, by default, returns a null KeyValue.
- Specified by:
getNextKeyHint
in interface Filter
- Overrides:
getNextKeyHint
in class FilterBase
- Returns:
- KeyValue which must be next seeked. return null if the filter is
not sure which key to seek to next.
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.