org.apache.hadoop.hbase.filter
Class ColumnRangeFilter
java.lang.Object
org.apache.hadoop.hbase.filter.FilterBase
org.apache.hadoop.hbase.filter.ColumnRangeFilter
- All Implemented Interfaces:
- Filter, org.apache.hadoop.io.Writable
public class ColumnRangeFilter
- extends 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.
Constructor Summary |
ColumnRangeFilter()
|
ColumnRangeFilter(byte[] minColumn,
boolean minColumnInclusive,
byte[] maxColumn,
boolean maxColumnInclusive)
Create a filter to select those keys with columns that are between minColumn
and maxColumn. |
minColumn
protected byte[] minColumn
minColumnInclusive
protected boolean minColumnInclusive
maxColumn
protected byte[] maxColumn
maxColumnInclusive
protected boolean maxColumnInclusive
ColumnRangeFilter
public ColumnRangeFilter()
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(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
createFilterFromArguments
public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
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.
toString
public String toString()
- Description copied from class:
FilterBase
- Return filter's info for debugging and logging purpose.
- Overrides:
toString
in class FilterBase
Copyright © 2015 The Apache Software Foundation. All Rights Reserved.