public class PartitionRangeQueryPager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected DataLimits |
limits |
protected ProtocolVersion |
protocolVersion |
protected T |
query |
EMPTY| Constructor and Description |
|---|
PartitionRangeQueryPager(PartitionRangeReadQuery query,
PagingState state,
ProtocolVersion protocolVersion) |
PartitionRangeQueryPager(PartitionRangeReadQuery query,
ProtocolVersion protocolVersion,
DecoratedKey lastReturnedKey,
PagingState.RowMark lastReturnedRow,
int remaining,
int remainingInPartition) |
| 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).
|
UnfilteredPartitionIterator |
fetchPageUnfiltered(TableMetadata metadata,
int pageSize,
ReadExecutionController executionController) |
boolean |
isExhausted()
Whether or not this pager is exhausted, i.e.
|
protected boolean |
isPreviouslyReturnedPartition(DecoratedKey key) |
int |
maxRemaining()
The maximum number of cells/CQL3 row that we may still have to return.
|
protected PartitionRangeReadQuery |
nextPageReadQuery(int pageSize) |
protected void |
recordLast(DecoratedKey key,
Row last) |
protected int |
remainingInPartition() |
protected void |
restoreState(DecoratedKey lastKey,
int remaining,
int remainingInPartition) |
PagingState |
state()
Get the current state of the pager.
|
PartitionRangeQueryPager |
withUpdatedLimit(DataLimits newLimits)
Creates a new
QueryPager that use the new limits. |
protected final T extends ReadQuery query
protected final DataLimits limits
protected final ProtocolVersion protocolVersion
public PartitionRangeQueryPager(PartitionRangeReadQuery query, PagingState state, ProtocolVersion protocolVersion)
public PartitionRangeQueryPager(PartitionRangeReadQuery query, ProtocolVersion protocolVersion, DecoratedKey lastReturnedKey, PagingState.RowMark lastReturnedRow, int remaining, int remainingInPartition)
public PartitionRangeQueryPager withUpdatedLimit(DataLimits newLimits)
QueryPagerQueryPager that use the new limits.newLimits - the new limitsQueryPager that use the new limitspublic PagingState state()
QueryPagerprotected PartitionRangeReadQuery nextPageReadQuery(int pageSize)
protected void recordLast(DecoratedKey key, Row last)
protected boolean isPreviouslyReturnedPartition(DecoratedKey key)
public 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)
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.public PartitionIterator fetchPageInternal(int pageSize, ReadExecutionController executionController)
QueryPagerfetchPageInternal in interface QueryPagerpageSize - the maximum number of elements to return in the next page.executionController - the ReadExecutionController protecting the read.public UnfilteredPartitionIterator fetchPageUnfiltered(TableMetadata metadata, int pageSize, ReadExecutionController executionController)
protected void restoreState(DecoratedKey lastKey, int remaining, int remainingInPartition)
public boolean isExhausted()
QueryPagerisExhausted in interface QueryPagerpublic int maxRemaining()
QueryPagermaxRemaining in interface QueryPagerprotected int remainingInPartition()
Copyright © 2009-2020 The Apache Software Foundation