Interface StreamedQueryResult
- All Superinterfaces:
org.reactivestreams.Publisher<Row>
The subscribe()
method cannot be called if isFailed()
is true.
-
Method Summary
Modifier and TypeMethodDescriptionReturns column names for these results.Returns column types for these results.Returns a newStreamedQueryResult
which starts returning results from the last saved continuation token.boolean
Returns whether theStreamedQueryResult
is complete.boolean
isFailed()
Returns whether theStreamedQueryResult
is failed.poll()
Returns the next row.Returns the next row.queryID()
Returns the ID of the underlying query if the query is a push query.Methods inherited from interface org.reactivestreams.Publisher
subscribe
-
Method Details
-
columnNames
Returns column names for these results.- Returns:
- the column names.
-
columnTypes
List<ColumnType> columnTypes()Returns column types for these results.- Returns:
- the column types.
-
queryID
String queryID()Returns the ID of the underlying query if the query is a push query. Else, returns null.- Returns:
- the query ID
-
poll
Row poll()Returns the next row. Blocks until one is available or the underlying query is terminated (either gracefully or because of an error).- Returns:
- the row, or null if the query was terminated.
-
poll
Returns the next row. Blocks until one is available, the specified timeout has elapsed, or the underlying query is terminated (either gracefully or because of an error).- Parameters:
timeout
- amount of time to wait for a row. A non-positive value will cause this method to block until a row is received or the query is terminated.- Returns:
- the row, or null if the timeout elapsed or the query was terminated.
-
isComplete
boolean isComplete()Returns whether theStreamedQueryResult
is complete.A
StreamedQueryResult
is complete if the HTTP connection associated with this query has been ended gracefully. Once complete, theStreamedQueryResult
will continue to deliver any remaining rows, then callonComplete()
on the subscriber, if present.- Returns:
- whether the
StreamedQueryResult
is complete.
-
isFailed
boolean isFailed()Returns whether theStreamedQueryResult
is failed.A
StreamedQueryResult
is failed if an error is received from the server. Once failed,onError()
is called on the subscriber, if present, any existingpoll()
calls will return null, and new calls topoll()
andsubscribe()
will be rejected.- Returns:
- whether the
StreamedQueryResult
is failed.
-
continueFromLastContinuationToken
CompletableFuture<StreamedQueryResult> continueFromLastContinuationToken()Returns a newStreamedQueryResult
which starts returning results from the last saved continuation token.This method will only work for push queries V2 when continuation tokens have also been enabled. It will not work for regular push queries or pull queries. This method will throw an error if there is no continuation token saved.
- Returns:
- a new
StreamedQueryResult
that continues from last continuation token.
-