org.apache.hadoop.hbase.filter
Class ColumnRangeFilter

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.FilterBase
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Field Summary
protected  byte[] maxColumn
           
protected  boolean maxColumnInclusive
           
protected  byte[] minColumn
           
protected  boolean minColumnInclusive
           
 
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.
 
Method Summary
static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
           
 Filter.ReturnCode filterKeyValue(KeyValue kv)
          Filters that dont filter by key value can inherit this implementation that includes all KeyValues.
 byte[] getMaxColumn()
           
 boolean getMaxColumnInclusive()
           
 byte[] getMinColumn()
           
 boolean getMinColumnInclusive()
           
 KeyValue getNextKeyHint(KeyValue kv)
          Filters that are not sure which key must be next seeked to, can inherit this implementation that, by default, returns a null KeyValue.
 boolean isMaxColumnInclusive()
           
 boolean isMinColumnInclusive()
           
 void readFields(DataInput in)
           
 String toString()
          Return filter's info for debugging and logging purpose.
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterAllRemaining, filterRow, filterRow, filterRowKey, hasFilterRow, isFamilyEssential, isFamilyEssential, reset, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

minColumn

protected byte[] minColumn

minColumnInclusive

protected boolean minColumnInclusive

maxColumn

protected byte[] maxColumn

maxColumnInclusive

protected boolean maxColumnInclusive
Constructor Detail

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.
Method Detail

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 © 2014 The Apache Software Foundation. All Rights Reserved.