A filter, based on the ColumnCountGetFilter, takes two arguments: limit and offset.
This filter can be used for row-based indexing, where references to other tables are stored across many columns,
in order to efficient lookups and paginated results for end users. Only most recent versions are considered
for pagination.

Constructor Detail

ColumnPaginationFilter

public ColumnPaginationFilter(int limit,
int offset)

Initializes filter with an integer offset and limit. The offset is arrived at
scanning sequentially and skipping entries. @limit number of columns are
then retrieved. If multiple column families are involved, the columns may be spread
across them.

Parameters:

limit - Max number of columns to return.

offset - The integer offset where to start pagination.

ColumnPaginationFilter

public ColumnPaginationFilter(int limit,
byte[] columnOffset)

Initializes filter with a string/bookmark based offset and limit. The offset is arrived
at, by seeking to it using scanner hints. If multiple column families are involved,
pagination starts at the first column family which contains @columnOffset. Columns are
then retrieved sequentially upto @limit number of columns which maybe spread across
multiple column families, depending on how the scan is setup.

Parameters:

limit - Max number of columns to return.

columnOffset - The string/bookmark offset on where to start pagination.

Method Detail

getLimit

public int getLimit()

Returns:

limit

getOffset

public int getOffset()

Returns:

offset

getColumnOffset

public byte[] getColumnOffset()

Returns:

columnOffset

filterKeyValue

A way to filter based on the column family, column qualifier and/or the column value. Return
code is described below. This allows filters to filter only certain number of columns, then
terminate without matching ever column.
If filterRowKey returns true, filterKeyValue needs to be consistent with it.
filterKeyValue can assume that filterRowKey has already been called for the row.
If your filter returns ReturnCode.NEXT_ROW, it should return
ReturnCode.NEXT_ROW until Filter.reset() is called just in case the caller calls
for the next row.
Concrete implementers can signal a failure condition in their code by throwing an
IOException.

The transformed KeyValue is what is eventually returned to the client. Most filters will
return the passed KeyValue unchanged.,
for an example of a
transformation.
Concrete implementers can signal a failure condition in their code by throwing an
{@link IOException}.