public interface ReactiveResultSet extends org.reactivestreams.Publisher<ReactiveRow>
Publisher
of ReactiveRow
s returned by a ReactiveSession
.
By default, all implementations returned by the driver are cold, unicast, single-subscriber only publishers. In other words, they do not support multiple subscriptions; consider caching the results produced by such publishers if you need to consume them by more than one downstream subscriber.
This interface exists mainly to expose useful information about request execution and query metadata. This is particularly convenient for queries that do not return rows; for queries that do return rows, it is also possible, and oftentimes easier, to access that same information at row level.
Modifier and Type | Method and Description |
---|---|
org.reactivestreams.Publisher<? extends com.datastax.oss.driver.api.core.cql.ColumnDefinitions> |
getColumnDefinitions()
Returns metadata about the columns contained in this result set.
|
org.reactivestreams.Publisher<? extends com.datastax.oss.driver.api.core.cql.ExecutionInfo> |
getExecutionInfos()
Returns information about the execution of all requests that have
been performed so far to assemble this result set.
|
org.reactivestreams.Publisher<Boolean> |
wasApplied()
If the query that produced this result was a conditional update, indicates whether it was
successfully applied.
|
@NonNull org.reactivestreams.Publisher<? extends com.datastax.oss.driver.api.core.cql.ColumnDefinitions> getColumnDefinitions()
This publisher emits exactly one item as soon as the first response arrives, then completes. If the query execution fails within the first request-response cycle, then this publisher will fail with the same error; however if the error happens after the first response, then this publisher will be already completed and will not acknowledge that error in any way.
By default, publishers returned by this method do not support multiple subscriptions.
ReactiveRow.getColumnDefinitions()
@NonNull org.reactivestreams.Publisher<? extends com.datastax.oss.driver.api.core.cql.ExecutionInfo> getExecutionInfos()
If the query is not paged, this publisher will emit exactly one item as soon as the response arrives, then complete. If the query is paged, it will emit multiple items, one per page; then it will complete when the last page arrives. If the query execution fails, then this publisher will fail with the same error.
By default, publishers returned by this method do not support multiple subscriptions.
ReactiveRow.getExecutionInfo()
@NonNull org.reactivestreams.Publisher<Boolean> wasApplied()
This publisher emits exactly one item as soon as the first response arrives, then completes. If the query execution fails within the first request-response cycle, then this publisher will fail with the same error; however if the error happens after the first response, then this publisher will be already completed and will not acknowledge that error in any way.
By default, publishers returned by this method do not support multiple subscriptions.
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.1.0-rc2, a server-side bug (CASSANDRA-7337) causes this
method to always return true
for batches containing conditional queries.
ReactiveRow.wasApplied()
Copyright © 2017–2019. All rights reserved.