public interface ContinuousResultSet
extends com.datastax.oss.driver.api.core.cql.ResultSet
It uses asynchronous calls internally, but blocks on the results in order to provide a synchronous API to its clients. If the query is paged, only the first page will be fetched initially, and iteration will trigger background fetches of the next pages when necessary.
Note that this object can only be iterated once: rows are "consumed" as they are read,
subsequent calls to iterator()
will return the same iterator instance.
Implementations of this type are not thread-safe. They can only be iterated by the
thread that invoked session.executeContinuously
.
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the continuous query.
|
default com.datastax.oss.driver.api.core.cql.ExecutionInfo |
getExecutionInfo() |
void cancel()
There might still be rows available in the current page after the cancellation; the iteration will only stop when such rows are fully iterated upon.
Also, there might be more pages available in the driver's local page cache after the cancellation; these extra pages will be discarded.
Therefore, if you plan to resume the iteration later, the correct procedure is as follows:
getExecutionInfo().getPagingState()
;
executeContinuously
again.
@NonNull default com.datastax.oss.driver.api.core.cql.ExecutionInfo getExecutionInfo()
Note: because the driver does not support query traces for continuous queries, ExecutionInfo.getTracingId()
will always be null
.
getExecutionInfo
in interface com.datastax.oss.driver.api.core.PagingIterable<com.datastax.oss.driver.api.core.cql.Row>
Copyright © 2017–2019. All rights reserved.