public interface ContinuousSession extends Session
Continuous paging is a new method of streaming bulk amounts of records from Datastax Enterprise (DSE) to the Datastax Java Driver, available since DSE 5.1. It is mainly intended to be leveraged by DSE Analytics and Apache Sparkā¢, or by any similar analytics tool that needs to read large portions of a table in one single operation, as quick and reliably as possible.
Continuous paging provides the best performance improvement against regular paging when the following conditions are met:
LoadBalancingPolicy
,
then this condition is met);
ONE
(or LOCAL_ONE
).
If the above conditions are met, the coordinator will be able to optimize the read path and serve results from local data, thus significantly improving response times; if however these conditions cannot be met, continuous paging would still work, but response times wouldn't be significantly better than those of regular paging anymore.
OSS_DRIVER_COORDINATES
Modifier and Type | Method and Description |
---|---|
default ContinuousResultSet |
executeContinuously(Statement<?> statement)
Executes the provided query with continuous paging synchronously.
|
default CompletionStage<ContinuousAsyncResultSet> |
executeContinuouslyAsync(Statement<?> statement)
Executes the provided query with continuous paging asynchronously.
|
checkSchemaAgreement, checkSchemaAgreementAsync, execute, getContext, getKeyspace, getMetadata, getMetrics, getName, isSchemaMetadataEnabled, refreshSchema, refreshSchemaAsync, setSchemaMetadataEnabled
close, closeAsync, closeFuture, forceCloseAsync, isClosed
@NonNull default ContinuousResultSet executeContinuously(@NonNull Statement<?> statement)
This method takes care of chaining the successive results into a convenient iterable, provided that you always access the result from the same thread. For more flexibility, consider using the asynchronous variant of this method instead.
See ContinuousSession
for more explanations about continuous paging.
This feature is only available with Datastax Enterprise. Executing continuous queries against an Apache Cassandra© cluster will result in a runtime error.
statement
- the query to execute.@NonNull default CompletionStage<ContinuousAsyncResultSet> executeContinuouslyAsync(@NonNull Statement<?> statement)
The server will push all requested pages asynchronously, according to the options defined in the current execution profile. 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.
See ContinuousSession
for more explanations about continuous paging.
This feature is only available with Datastax Enterprise. Executing continuous queries against an Apache Cassandra© cluster will result in a runtime error.
statement
- the query to execute.Copyright © 2017–2020. All rights reserved.