org.apache.hadoop.hbase.filter
Class ColumnPrefixFilter
java.lang.Object
org.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.ColumnPrefixFilter
@InterfaceAudience.Public
@InterfaceStability.Stable
public class ColumnPrefixFilter
- extends org.apache.hadoop.hbase.filter.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 with
columns like 'and', 'anti' but not keys with columns like 'ball', 'act'.
Field Summary |
protected byte[] |
prefix
|
Fields inherited from class org.apache.hadoop.hbase.filter.Filter |
reversed |
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase |
filterAllRemaining, filterRow, filterRow, filterRowCells, filterRowKey, getNextKeyHint, hasFilterRow, isFamilyEssential, reset, transform, transformCell |
prefix
protected byte[] prefix
ColumnPrefixFilter
public ColumnPrefixFilter(byte[] prefix)
getPrefix
public byte[] getPrefix()
filterKeyValue
public Filter.ReturnCode filterKeyValue(Cell kv)
- Description copied from class:
org.apache.hadoop.hbase.filter.FilterBase
- Filters that dont filter by key value can inherit this implementation that
includes all Cells.
- Overrides:
filterKeyValue
in class org.apache.hadoop.hbase.filter.FilterBase
- Parameters:
kv
- the Cell in question
- Returns:
- code as described below
- See Also:
Filter.ReturnCode
filterColumn
public Filter.ReturnCode filterColumn(byte[] buffer,
int qualifierOffset,
int qualifierLength)
createFilterFromArguments
public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
toByteArray
public byte[] toByteArray()
- Description copied from class:
org.apache.hadoop.hbase.filter.FilterBase
- Return length 0 byte array for Filters that don't require special serialization
- Overrides:
toByteArray
in class org.apache.hadoop.hbase.filter.FilterBase
- Returns:
- The filter serialized using pb
parseFrom
public static ColumnPrefixFilter parseFrom(byte[] pbBytes)
throws org.apache.hadoop.hbase.exceptions.DeserializationException
- Parameters:
pbBytes
- A pb serialized ColumnPrefixFilter
instance
- Returns:
- An instance of
ColumnPrefixFilter
made from bytes
- Throws:
org.apache.hadoop.hbase.exceptions.DeserializationException
- See Also:
toByteArray()
getNextCellHint
public Cell getNextCellHint(Cell kv)
- Description copied from class:
org.apache.hadoop.hbase.filter.FilterBase
- Filters that are not sure which key must be next seeked to, can inherit
this implementation that, by default, returns a null Cell.
- Overrides:
getNextCellHint
in class org.apache.hadoop.hbase.filter.FilterBase
- Returns:
- KeyValue which must be next seeked. return null if the filter is not sure which key to
seek to next.
toString
public String toString()
- Description copied from class:
org.apache.hadoop.hbase.filter.FilterBase
- Return filter's info for debugging and logging purpose.
- Overrides:
toString
in class org.apache.hadoop.hbase.filter.FilterBase
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.