org.apache.hadoop.hbase.filter
Class ColumnRangeFilter
java.lang.Object
org.apache.hadoop.hbase.filter.Filter
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.ColumnRangeFilter
@InterfaceAudience.Public
@InterfaceStability.Stable
public class ColumnRangeFilter
- extends org.apache.hadoop.hbase.filter.FilterBase
This filter is used for selecting only those keys with columns that are
between minColumn to maxColumn. For example, if minColumn is 'an', and
maxColumn is 'be', it will pass keys with columns like 'ana', 'bad', but not
keys with columns like 'bed', 'eye'
If minColumn is null, there is no lower bound. If maxColumn is null, there is
no upper bound.
minColumnInclusive and maxColumnInclusive specify if the ranges are inclusive
or not.
Fields inherited from class org.apache.hadoop.hbase.filter.Filter |
reversed |
Constructor Summary |
ColumnRangeFilter(byte[] minColumn,
boolean minColumnInclusive,
byte[] maxColumn,
boolean maxColumnInclusive)
Create a filter to select those keys with columns that are between minColumn
and maxColumn. |
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase |
filterAllRemaining, filterRow, filterRow, filterRowCells, filterRowKey, getNextKeyHint, hasFilterRow, isFamilyEssential, reset, transform, transformCell |
minColumn
protected byte[] minColumn
minColumnInclusive
protected boolean minColumnInclusive
maxColumn
protected byte[] maxColumn
maxColumnInclusive
protected boolean maxColumnInclusive
ColumnRangeFilter
public ColumnRangeFilter(byte[] minColumn,
boolean minColumnInclusive,
byte[] maxColumn,
boolean maxColumnInclusive)
- Create a filter to select those keys with columns that are between minColumn
and maxColumn.
- Parameters:
minColumn
- minimum value for the column range. If if it's null,
there is no lower bound.minColumnInclusive
- if true, include minColumn in the range.maxColumn
- maximum value for the column range. If it's null,maxColumnInclusive
- if true, include maxColumn in the range.
there is no upper bound.
isMinColumnInclusive
public boolean isMinColumnInclusive()
- Returns:
- if min column range is inclusive.
isMaxColumnInclusive
public boolean isMaxColumnInclusive()
- Returns:
- if max column range is inclusive.
getMinColumn
public byte[] getMinColumn()
- Returns:
- the min column range for the filter
getMinColumnInclusive
public boolean getMinColumnInclusive()
- Returns:
- true if min column is inclusive, false otherwise
getMaxColumn
public byte[] getMaxColumn()
- Returns:
- the max column range for the filter
getMaxColumnInclusive
public boolean getMaxColumnInclusive()
- Returns:
- true if max column is inclusive, false otherwise
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
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 ColumnRangeFilter parseFrom(byte[] pbBytes)
throws org.apache.hadoop.hbase.exceptions.DeserializationException
- Parameters:
pbBytes
- A pb serialized ColumnRangeFilter
instance
- Returns:
- An instance of
ColumnRangeFilter
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–2015 The Apache Software Foundation. All rights reserved.