Package com.google.cloud.spanner.spi.v1
Interface SpannerRpc.ResultStreamConsumer
- Enclosing interface:
- SpannerRpc
public static interface SpannerRpc.ResultStreamConsumer
Consumer for the results produced by a streaming read or query call.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the stream should be cancelled when the Spanner client is closed.voidvoidvoidonPartialResultSet(PartialResultSet results)
-
Method Details
-
onPartialResultSet
-
onCompleted
void onCompleted() -
onError
-
cancelQueryWhenClientIsClosed
boolean cancelQueryWhenClientIsClosed()Returns true if the stream should be cancelled when the Spanner client is closed. This returns true forBatchReadOnlyTransaction, as these use a non-pooled session. Pooled sessions are deleted when the Spanner client is closed, and this automatically also cancels any query that uses the session, which means that we don't need to explicitly cancel those queries when the Spanner client is closed.
-