org.apache.hadoop.hbase.filter
Class MultipleColumnPrefixFilter

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.FilterBase
      extended by org.apache.hadoop.hbase.filter.MultipleColumnPrefixFilter
All Implemented Interfaces:
Filter, org.apache.hadoop.io.Writable

public class MultipleColumnPrefixFilter
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'.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Field Summary
protected  byte[] hint
           
protected  TreeSet<byte[]> sortedPrefixes
           
 
Constructor Summary
MultipleColumnPrefixFilter()
           
MultipleColumnPrefixFilter(byte[][] prefixes)
           
 
Method Summary
static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
           
 TreeSet<byte[]> createTreeSet()
           
 Filter.ReturnCode filterColumn(byte[] buffer, int qualifierOffset, int qualifierLength)
           
 Filter.ReturnCode filterKeyValue(KeyValue kv)
          Filters that dont filter by key value can inherit this implementation that includes all KeyValues.
 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.
 byte[][] getPrefix()
           
 void readFields(DataInput in)
           
 String toString()
          Return filter's info for debugging and logging purpose.
protected  String toString(int maxPrefixes)
           
 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

hint

protected byte[] hint

sortedPrefixes

protected TreeSet<byte[]> sortedPrefixes
Constructor Detail

MultipleColumnPrefixFilter

public MultipleColumnPrefixFilter()

MultipleColumnPrefixFilter

public MultipleColumnPrefixFilter(byte[][] prefixes)
Method Detail

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)

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.

createTreeSet

public TreeSet<byte[]> createTreeSet()

toString

public String toString()
Description copied from class: FilterBase
Return filter's info for debugging and logging purpose.

Overrides:
toString in class FilterBase

toString

protected String toString(int maxPrefixes)


Copyright © 2015 The Apache Software Foundation. All Rights Reserved.