public interface ContinuousPagingSession extends Session
This interface exists solely for backward compatibility purposes, because adding the methods
directly to Session
would have broken clients that implemented it. In practice, any
session returned by the driver is also a continuous paging session, and can be safely casted.
This will be merged in the parent interface in the next major version.
Session.State
Modifier and Type | Method and Description |
---|---|
ContinuousPagingResult |
executeContinuously(Statement statement,
ContinuousPagingOptions options)
Convenience method to execute a continuous query in a synchronous context.
|
ListenableFuture<AsyncContinuousPagingResult> |
executeContinuouslyAsync(Statement statement,
ContinuousPagingOptions options)
Executes the provided query with continuous paging.
|
close, closeAsync, execute, execute, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, getCluster, getLoggedKeyspace, getState, init, initAsync, isClosed, prepare, prepare, prepareAsync, prepareAsync
ListenableFuture<AsyncContinuousPagingResult> executeContinuouslyAsync(Statement statement, ContinuousPagingOptions options)
The server will push all requested pages asynchronously, according to the options passed in as a parameter. The client should consume all pages as quickly as possible, to avoid blocking the server for too long. The server will adjust the rate according to the client speed, but it will give up if the client does not consume any pages in a period of time equal to the read request timeout.
This functionality is typically used by tools that want to retrieve the entire data set as
quickly as possible, typically for analytics queries. Such tools should also make sure to
contact a replica directly, by setting a routing key or token in the statement, so that the
server can further optimize ConsistencyLevel.ONE
queries by reading data from local
disk and keeping iterators open across pages. This optimization is only available if the
coordinator is a replica and the consistency level is ONE
. If this is not the case, the
coordinator will retrieve pages one by one from replicas. Note that when the optimization kicks
in (range query at ONE
performed directly on a replica), the snitch is bypassed and the
coordinator will always chose itself as a replica. Therefore, other functionality such as
probabilistic read repair and speculative retry is also not available when contacting a replica
at ONE
.
statement
- the CQL query to execute (that can be any Statement
).options
- the query options (this can't be null).ContinuousPagingResult executeContinuously(Statement statement, ContinuousPagingOptions options)
This method calls executeContinuouslyAsync(Statement, ContinuousPagingOptions)
internally, and takes care of chaining the successive results into a convenient iterable,
provided that you always access the result from the same thread.
statement
- the CQL query to execute (that can be any Statement
).options
- the query options (this can't be null).Copyright © 2012–2018. All rights reserved.