org.apache.hadoop.hbase.filter
Class ColumnCountGetFilter

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.ColumnCountGetFilter

@InterfaceAudience.Public
@InterfaceStability.Stable
public class ColumnCountGetFilter
extends org.apache.hadoop.hbase.filter.FilterBase

Simple filter that returns first N columns on row only. This filter was written to test filters in Get and as soon as it gets its quota of columns, filterAllRemaining() returns true. This makes this filter unsuitable as a Scan filter.


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
ColumnCountGetFilter(int n)
           
 
Method Summary
static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
           
 boolean filterAllRemaining()
          Filters that never filter all remaining can inherit this implementation that never stops the filter early.
 Filter.ReturnCode filterKeyValue(Cell v)
          Filters that dont filter by key value can inherit this implementation that includes all Cells.
 int getLimit()
           
static ColumnCountGetFilter parseFrom(byte[] pbBytes)
           
 void reset()
          Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation.
 byte[] toByteArray()
          Return length 0 byte array for Filters that don't require special serialization
 String toString()
          Return filter's info for debugging and logging purpose.
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterRow, filterRow, filterRowCells, filterRowKey, getNextCellHint, getNextKeyHint, hasFilterRow, isFamilyEssential, 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

ColumnCountGetFilter

public ColumnCountGetFilter(int n)
Method Detail

getLimit

public int getLimit()

filterAllRemaining

public boolean filterAllRemaining()
Description copied from class: org.apache.hadoop.hbase.filter.FilterBase
Filters that never filter all remaining can inherit this implementation that never stops the filter early.

Overrides:
filterAllRemaining in class org.apache.hadoop.hbase.filter.FilterBase
Returns:
true to end scan, false to continue.

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 org.apache.hadoop.hbase.filter.FilterBase
Parameters:
v - the Cell in question
Returns:
code as described below
See Also:
Filter.ReturnCode

reset

public void reset()
Description copied from class: org.apache.hadoop.hbase.filter.FilterBase
Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation.

Overrides:
reset in class org.apache.hadoop.hbase.filter.FilterBase

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 ColumnCountGetFilter parseFrom(byte[] pbBytes)
                                      throws org.apache.hadoop.hbase.exceptions.DeserializationException
Parameters:
pbBytes - A pb serialized ColumnCountGetFilter instance
Returns:
An instance of ColumnCountGetFilter made from bytes
Throws:
org.apache.hadoop.hbase.exceptions.DeserializationException
See Also:
toByteArray()

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 © 2015 The Apache Software Foundation. All rights reserved.