public class MultiPartitionPager extends java.lang.Object implements QueryPager
EMPTY| Constructor and Description |
|---|
MultiPartitionPager(SinglePartitionReadCommand.Group group,
PagingState state,
ProtocolVersion protocolVersion) |
| Modifier and Type | Method and Description |
|---|---|
ReadExecutionController |
executionController()
Starts a new read operation.
|
PartitionIterator |
fetchPage(int pageSize,
ConsistencyLevel consistency,
ClientState clientState,
long queryStartNanoTime)
Fetches the next page.
|
PartitionIterator |
fetchPageInternal(int pageSize,
ReadExecutionController executionController)
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.
|
PagingState |
state()
Get the current state of the pager.
|
QueryPager |
withUpdatedLimit(DataLimits newLimits)
Creates a new
QueryPager that use the new limits. |
public MultiPartitionPager(SinglePartitionReadCommand.Group group, PagingState state, ProtocolVersion protocolVersion)
public QueryPager withUpdatedLimit(DataLimits newLimits)
QueryPagerQueryPager that use the new limits.withUpdatedLimit in interface QueryPagernewLimits - the new limitsQueryPager that use the new limitspublic PagingState state()
QueryPagerstate in interface QueryPagerpublic boolean isExhausted()
QueryPagerisExhausted in interface QueryPagerpublic ReadExecutionController executionController()
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.
executionController in interface QueryPagerQueryPager.public PartitionIterator fetchPage(int pageSize, ConsistencyLevel consistency, ClientState clientState, long queryStartNanoTime) 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, ReadExecutionController executionController) throws RequestValidationException, RequestExecutionException
QueryPagerfetchPageInternal in interface QueryPagerpageSize - the maximum number of elements to return in the next page.executionController - the ReadExecutionController protecting the read.RequestValidationExceptionRequestExecutionExceptionpublic int maxRemaining()
QueryPagermaxRemaining in interface QueryPagerCopyright © 2018 The Apache Software Foundation