public class SinglePartitionPager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected DataLimits |
limits |
EMPTY| Constructor and Description |
|---|
SinglePartitionPager(SinglePartitionReadCommand<?> command,
PagingState state) |
| Modifier and Type | Method and Description |
|---|---|
PartitionIterator |
fetchPage(int pageSize,
ConsistencyLevel consistency,
ClientState clientState)
Fetches the next page.
|
PartitionIterator |
fetchPageInternal(int pageSize,
ReadOrderGroup orderGroup)
Fetches the next page internally (in other, this does a local query).
|
boolean |
isExhausted()
Whether or not this pager is exhausted, i.e.
|
java.nio.ByteBuffer |
key() |
DataLimits |
limits() |
int |
maxRemaining()
The maximum number of cells/CQL3 row that we may still have to return.
|
protected ReadCommand |
nextPageReadCommand(int pageSize) |
protected void |
recordLast(DecoratedKey key,
Row last) |
protected int |
remainingInPartition() |
protected void |
restoreState(DecoratedKey lastKey,
int remaining,
int remainingInPartition) |
ReadOrderGroup |
startOrderGroup()
Starts a new read operation.
|
PagingState |
state()
Get the current state of the pager.
|
protected final DataLimits limits
public SinglePartitionPager(SinglePartitionReadCommand<?> command, PagingState state)
public java.nio.ByteBuffer key()
public DataLimits limits()
public PagingState state()
QueryPagerprotected ReadCommand nextPageReadCommand(int pageSize)
protected void recordLast(DecoratedKey key, Row last)
public ReadOrderGroup startOrderGroup()
QueryPager
This must be called before fetchPageInternal and passed to it to protect the read.
The returned object must be closed on all path and it is thus strongly advised to
use it in a try-with-ressource construction.
startOrderGroup in interface QueryPagerQueryPager.public PartitionIterator fetchPage(int pageSize, ConsistencyLevel consistency, ClientState clientState) throws RequestValidationException, RequestExecutionException
QueryPagerfetchPage in interface QueryPagerpageSize - the maximum number of elements to return in the next page.consistency - the consistency level to achieve for the query.clientState - the ClientState for the query. In practice, this can be null unless
consistency is a serial consistency.RequestValidationExceptionRequestExecutionExceptionpublic PartitionIterator fetchPageInternal(int pageSize, ReadOrderGroup orderGroup) throws RequestValidationException, RequestExecutionException
QueryPagerfetchPageInternal in interface QueryPagerpageSize - the maximum number of elements to return in the next page.orderGroup - the ReadOrderGroup protecting the read.RequestValidationExceptionRequestExecutionExceptionprotected void restoreState(DecoratedKey lastKey, int remaining, int remainingInPartition)
public boolean isExhausted()
QueryPagerisExhausted in interface QueryPagerpublic int maxRemaining()
QueryPagermaxRemaining in interface QueryPagerprotected int remainingInPartition()
Copyright © 2015 The Apache Software Foundation