All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.driver.core.AsyncContinuousPagingResult Maven / Gradle / Ivy

Go to download

A driver for DataStax Enterprise (DSE) and Apache Cassandra 1.2+ clusters that works exclusively with the Cassandra Query Language version 3 (CQL3) and Cassandra's binary protocol, supporting DSE-specific features such as geospatial types, DSE Graph and DSE authentication.

There is a newer version: 2.4.0
Show newest version
/*
 *      Copyright (C) 2012-2017 DataStax Inc.
 *
 *      This software can be used solely with DataStax Enterprise. Please consult the license at
 *      http://www.datastax.com/terms/datastax-dse-driver-license-terms
 */
package com.datastax.driver.core;

import com.google.common.util.concurrent.ListenableFuture;

/**
 * The result of an {@link ContinuousPagingSession#executeContinuouslyAsync(Statement, ContinuousPagingOptions)
 * asynchronous continuous paging query}.
 * 

* DSE replies to a continuous query with a stream of response frame. There is one instance of this class for each * frame. */ public interface AsyncContinuousPagingResult { /** * Returns an iterable of the rows in the current page. *

* More results might be available via {@link #nextPage()}. */ Iterable currentPage(); /** * Indicates if this is the last page in the stream of results. */ boolean isLast(); /** * Returns a future wrapping the next page in the stream of results. *

* This will return a failed future for the last page; you should always check {@link #isLast()} before calling this * method. */ ListenableFuture nextPage(); /** * Returns the definition of the columns returned in this result set. */ ColumnDefinitions getColumnDefinitions(); /** * Returns the page number. */ int pageNumber(); /** * Cancels the continuous query. *

* The driver will send an additional request to ask DSE to stop sending results. Because that request is * asynchronous (and because the driver caches pages locally), there will probably be more pages available (via * {@link #nextPage()}) after a call to this method. However, note that the server does not set {@link #isLast()} * after a cancellation, so there is no reliable way to detect how many of these remaining pages are left. */ void cancel(); /** * Returns information on the execution of the query, and on the response frame used to build this result. *

* In particular, it contains the paging state for the current page. *

* The driver does not support query traces for continuous queries, the corresponding field will always be * {@code null}. */ ExecutionInfo getExecutionInfo(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy