Interface ReactiveResultSet


public interface ReactiveResultSet
The reactive result of a query.

The retrieval of the rows of a ReactiveResultSet is generally paged (a first page of result is fetched and the next one is only fetched once all the results of the first one has been consumed). The size of the pages can be configured either globally or per-statement with Statement.setPageSize(int).

Please note however that this ReactiveResultSet paging is not available with the version 1 of the native protocol (i.e. with Cassandra 1.2 or if version 1 has been explicitly requested). If the protocol version 1 is in use, a ReactiveResultSet is always fetched in it's entirely and it's up to the client to make sure that no query can yield ReactiveResultSet that won't hold in memory.

Note that this class is not thread-safe.

Since:
2.0
Author:
Mark Paluch
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Flux<com.datastax.oss.driver.api.core.cql.Row>
    Returns a Flux over the rows contained in this result set chunk.
    List<com.datastax.oss.driver.api.core.cql.ExecutionInfo>
    Return the execution information for all queries made to retrieve this ReactiveResultSet.
    com.datastax.oss.driver.api.core.cql.ColumnDefinitions
    Returns the columns returned in this ReactiveResultSet.
    com.datastax.oss.driver.api.core.cql.ExecutionInfo
    Returns information on the execution of the last query made for this ReactiveResultSet.
    reactor.core.publisher.Flux<com.datastax.oss.driver.api.core.cql.Row>
    Returns a Flux over the rows contained in this result set applying transparent paging.
    boolean
    If the query that produced this ResultSet was a conditional update, return whether it was successfully applied.
  • Method Details

    • rows

      reactor.core.publisher.Flux<com.datastax.oss.driver.api.core.cql.Row> rows()
      Returns a Flux over the rows contained in this result set applying transparent paging.

      The Flux will stream over all records that in this ReactiveResultSet according to the reactive demand and fetch next result chunks by issuing the underlying query with the current paging state applied.

      Returns:
      a Flux of rows that will stream over all rows of the entire result.
    • availableRows

      reactor.core.publisher.Flux<com.datastax.oss.driver.api.core.cql.Row> availableRows()
      Returns a Flux over the rows contained in this result set chunk. This method does not apply transparent paging. Use paging state from getExecutionInfo() to issue subsequent queries to obtain the next result chunk.
      Returns:
      a Flux of rows that will stream over all rows in this ReactiveResultSet.
      Since:
      2.1
    • getColumnDefinitions

      com.datastax.oss.driver.api.core.cql.ColumnDefinitions getColumnDefinitions()
      Returns the columns returned in this ReactiveResultSet.
      Returns:
      the columns returned in this ReactiveResultSet.
    • wasApplied

      boolean wasApplied()
      If the query that produced this ResultSet was a conditional update, return whether it was successfully applied.

      For consistency, this method always returns true for non-conditional queries (although there is no reason to call the method in that case). This is also the case for conditional DDL statements (CREATE KEYSPACE... IF NOT EXISTS, CREATE TABLE... IF NOT EXISTS), for which Cassandra doesn't return an [applied] column.

      Note that, for versions of Cassandra strictly lower than 2.0.9 and 2.1.0-rc2, a server-side bug (CASSANDRA-7337) causes this method to always return true for batches containing conditional queries.

      Returns:
      if the query was a conditional update, whether it was applied. true for other types of queries.
      See Also:
    • getExecutionInfo

      com.datastax.oss.driver.api.core.cql.ExecutionInfo getExecutionInfo()
      Returns information on the execution of the last query made for this ReactiveResultSet.

      Note that in most cases, a result set is fetched with only one query, but large result sets can be paged and thus be retrieved by multiple queries. In that case this method return the ExecutionInfo for the last query performed. To retrieve the information for all queries, use getAllExecutionInfo().

      The returned object includes basic information such as the queried hosts, but also the Cassandra query trace if tracing was enabled for the query.

      Returns:
      the ExecutionInfo for the last query made for this ReactiveResultSet.
    • getAllExecutionInfo

      List<com.datastax.oss.driver.api.core.cql.ExecutionInfo> getAllExecutionInfo()
      Return the execution information for all queries made to retrieve this ReactiveResultSet.

      Unless the result set is large enough to get paged underneath, the returned list will be singleton. If paging has been used however, the returned list contains the ExecutionInfo objects for all the queries done to obtain this result set (at the time of the call) in the order those queries were made.

      Returns:
      a list of the ExecutionInfo for all the queries made for this ReactiveResultSet.