@NotThreadSafe public class DefaultContinuousResultSet extends Object implements ContinuousResultSet
MultiPageResultSet
, except that RowIterator#maybeMoveToNextPage()
needs to check for cancellation before fetching the next page.Constructor and Description |
---|
DefaultContinuousResultSet(ContinuousAsyncResultSet firstPage) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the continuous query.
|
int |
getAvailableWithoutFetching() |
com.datastax.oss.driver.api.core.cql.ColumnDefinitions |
getColumnDefinitions() |
List<com.datastax.oss.driver.api.core.cql.ExecutionInfo> |
getExecutionInfos() |
boolean |
isFullyFetched() |
Iterator<com.datastax.oss.driver.api.core.cql.Row> |
iterator() |
boolean |
wasApplied() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getExecutionInfo
forEach, spliterator
public DefaultContinuousResultSet(ContinuousAsyncResultSet firstPage)
public void cancel()
ContinuousResultSet
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.
cancel
in interface ContinuousResultSet
@NonNull public com.datastax.oss.driver.api.core.cql.ColumnDefinitions getColumnDefinitions()
getColumnDefinitions
in interface com.datastax.oss.driver.api.core.PagingIterable<com.datastax.oss.driver.api.core.cql.Row>
@NonNull public List<com.datastax.oss.driver.api.core.cql.ExecutionInfo> getExecutionInfos()
getExecutionInfos
in interface com.datastax.oss.driver.api.core.PagingIterable<com.datastax.oss.driver.api.core.cql.Row>
@NonNull public Iterator<com.datastax.oss.driver.api.core.cql.Row> iterator()
public boolean isFullyFetched()
isFullyFetched
in interface com.datastax.oss.driver.api.core.PagingIterable<com.datastax.oss.driver.api.core.cql.Row>
public int getAvailableWithoutFetching()
getAvailableWithoutFetching
in interface com.datastax.oss.driver.api.core.PagingIterable<com.datastax.oss.driver.api.core.cql.Row>
public boolean wasApplied()
wasApplied
in interface com.datastax.oss.driver.api.core.cql.ResultSet
wasApplied
in interface com.datastax.oss.driver.api.core.PagingIterable<com.datastax.oss.driver.api.core.cql.Row>
Copyright © 2017–2019. All rights reserved.