@NotThreadSafe public class DefaultContinuousAsyncResultSet extends Object implements ContinuousAsyncResultSet
Constructor and Description |
---|
DefaultContinuousAsyncResultSet(com.datastax.oss.driver.internal.core.util.CountingIterator<Row> iterator,
ColumnDefinitions columnDefinitions,
int pageNumber,
boolean hasMorePages,
ExecutionInfo executionInfo,
ContinuousCqlRequestHandler handler) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the continuous query.
|
Iterable<Row> |
currentPage() |
CompletionStage<ContinuousAsyncResultSet> |
fetchNextPage() |
ColumnDefinitions |
getColumnDefinitions() |
ExecutionInfo |
getExecutionInfo() |
boolean |
hasMorePages() |
int |
pageNumber()
Returns the current page's number.
|
int |
remaining() |
boolean |
wasApplied() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
map, one
public DefaultContinuousAsyncResultSet(com.datastax.oss.driver.internal.core.util.CountingIterator<Row> iterator, ColumnDefinitions columnDefinitions, int pageNumber, boolean hasMorePages, ExecutionInfo executionInfo, ContinuousCqlRequestHandler handler)
@NonNull public ColumnDefinitions getColumnDefinitions()
getColumnDefinitions
in interface AsyncPagingIterable<Row,ContinuousAsyncResultSet>
public boolean wasApplied()
wasApplied
in interface AsyncPagingIterable<Row,ContinuousAsyncResultSet>
@NonNull public ExecutionInfo getExecutionInfo()
ContinuousAsyncResultSet
Note: because the driver does not support query traces for continuous queries, ExecutionInfo.getTracingId()
will always be null
.
getExecutionInfo
in interface ContinuousAsyncResultSet
getExecutionInfo
in interface AsyncPagingIterable<Row,ContinuousAsyncResultSet>
public int pageNumber()
ContinuousAsyncResultSet
pageNumber
in interface ContinuousAsyncResultSet
public boolean hasMorePages()
hasMorePages
in interface AsyncPagingIterable<Row,ContinuousAsyncResultSet>
@NonNull public Iterable<Row> currentPage()
currentPage
in interface AsyncPagingIterable<Row,ContinuousAsyncResultSet>
public int remaining()
remaining
in interface AsyncPagingIterable<Row,ContinuousAsyncResultSet>
@NonNull public CompletionStage<ContinuousAsyncResultSet> fetchNextPage() throws IllegalStateException
fetchNextPage
in interface AsyncPagingIterable<Row,ContinuousAsyncResultSet>
IllegalStateException
public void cancel()
ContinuousAsyncResultSet
There might still be rows available in the current page after the cancellation; these rows can be retrieved normally.
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()
;
executeContinuouslyAsync
again.
AsyncPagingIterable.fetchNextPage()
that are not yet complete
will always complete exceptionally by throwing a CancellationException
, even if
they were obtained before the cancellation.cancel
in interface ContinuousAsyncResultSet
Copyright © 2017–2019. All rights reserved.