public class MultiPartitionPager extends java.lang.Object implements QueryPager
EMPTY
Constructor and Description |
---|
MultiPartitionPager(SinglePartitionReadCommand.Group group,
PagingState state,
int protocolVersion) |
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.
|
int |
maxRemaining()
The maximum number of cells/CQL3 row that we may still have to return.
|
ReadOrderGroup |
startOrderGroup()
Starts a new read operation.
|
PagingState |
state()
Get the current state of the pager.
|
public MultiPartitionPager(SinglePartitionReadCommand.Group group, PagingState state, int protocolVersion)
public PagingState state()
QueryPager
state
in interface QueryPager
public boolean isExhausted()
QueryPager
isExhausted
in interface QueryPager
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 QueryPager
QueryPager
.public PartitionIterator fetchPage(int pageSize, ConsistencyLevel consistency, ClientState clientState) throws RequestValidationException, RequestExecutionException
QueryPager
fetchPage
in interface QueryPager
pageSize
- 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.RequestValidationException
RequestExecutionException
public PartitionIterator fetchPageInternal(int pageSize, ReadOrderGroup orderGroup) throws RequestValidationException, RequestExecutionException
QueryPager
fetchPageInternal
in interface QueryPager
pageSize
- the maximum number of elements to return in the next page.orderGroup
- the ReadOrderGroup
protecting the read.RequestValidationException
RequestExecutionException
public int maxRemaining()
QueryPager
maxRemaining
in interface QueryPager
Copyright © 2016 The Apache Software Foundation