org.apache.hadoop.hbase.filter
Class FirstKeyValueMatchingQualifiersFilter

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.Filter
      extended by org.apache.hadoop.hbase.filter.FilterBase
          extended by org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter
              extended by org.apache.hadoop.hbase.filter.FirstKeyValueMatchingQualifiersFilter

@InterfaceAudience.Public
@InterfaceStability.Stable
public class FirstKeyValueMatchingQualifiersFilter
extends FirstKeyOnlyFilter

The filter looks for the given columns in KeyValue. Once there is a match for any one of the columns, it returns ReturnCode.NEXT_ROW for remaining KeyValues in the row.

Note : It may emit KVs which do not have the given columns in them, if these KVs happen to occur before a KV which does have a match. Given this caveat, this filter is only useful for special cases like RowCounter.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.filter.Filter
reversed
 
Constructor Summary
FirstKeyValueMatchingQualifiersFilter(Set<byte[]> qualifiers)
          Constructor which takes a set of columns.
 
Method Summary
 Filter.ReturnCode filterKeyValue(Cell v)
          Filters that dont filter by key value can inherit this implementation that includes all Cells.
static FirstKeyValueMatchingQualifiersFilter parseFrom(byte[] pbBytes)
           
 byte[] toByteArray()
          Return length 0 byte array for Filters that don't require special serialization
 
Methods inherited from class org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter
createFilterFromArguments, hasFoundKV, reset, setFoundKV
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterAllRemaining, filterRow, filterRow, filterRowCells, filterRowKey, getNextCellHint, getNextKeyHint, hasFilterRow, isFamilyEssential, toString, transform, transformCell
 
Methods inherited from class org.apache.hadoop.hbase.filter.Filter
isReversed, setReversed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FirstKeyValueMatchingQualifiersFilter

public FirstKeyValueMatchingQualifiersFilter(Set<byte[]> qualifiers)
Constructor which takes a set of columns. As soon as first KeyValue matching any of these columns is found, filter moves to next row.

Parameters:
qualifiers - the set of columns to me matched.
Method Detail

filterKeyValue

public Filter.ReturnCode filterKeyValue(Cell v)
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 FirstKeyOnlyFilter
Parameters:
v - the Cell in question
Returns:
code as described below
See Also:
Filter.ReturnCode

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 FirstKeyOnlyFilter
Returns:
The filter serialized using pb

parseFrom

public static FirstKeyValueMatchingQualifiersFilter parseFrom(byte[] pbBytes)
                                                       throws org.apache.hadoop.hbase.exceptions.DeserializationException
Parameters:
pbBytes - A pb serialized FirstKeyValueMatchingQualifiersFilter instance
Returns:
An instance of FirstKeyValueMatchingQualifiersFilter made from bytes
Throws:
org.apache.hadoop.hbase.exceptions.DeserializationException
See Also:
toByteArray()


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.