public abstract class StreamableQuery<SnapshotType>
Represents a query whose results can be streamed. If the stream fails with a retryable error,
implementations of StreamableQuery can optionally support retries with a cursor, as indicated by
isRetryableWithCursor
. Retrying with a cursor means that the StreamableQuery can be resumed
where it failed by first calling startAfter(lastDocumentReceived)
.
Type Parameter |
|
---|---|
Name | Description |
SnapshotType |
Methods
explain(ExplainOptions options)
public ApiFuture<ExplainResults<SnapshotType>> explain(ExplainOptions options)
Plans and optionally executes this query. Returns an ApiFuture that will be resolved with the planner information, statistics from the query execution (if any), and the query results (if any).
Parameter | |
---|---|
Name | Description |
options |
ExplainOptions |
Returns | |
---|---|
Type | Description |
ApiFuture<ExplainResults<SnapshotType>> |
An ApiFuture that will be resolved with the planner information, statistics from the query execution (if any), and the query results (if any). |
get()
public abstract ApiFuture<SnapshotType> get()
Executes the query and returns the results as QuerySnapshot.
Returns | |
---|---|
Type | Description |
ApiFuture<SnapshotType> |
An ApiFuture that will be resolved with the results of the Query. |
getFirestore()
public Firestore getFirestore()
Gets the Firestore instance associated with this query.
Returns | |
---|---|
Type | Description |
Firestore |
The Firestore instance associated with this query. |
internalStream(ApiStreamObserver<RunQueryResponse> runQueryResponseObserver, long startTimeNanos, ByteString transactionId, Timestamp readTime, ExplainOptions explainOptions, boolean isRetryRequestWithCursor)
protected void internalStream(ApiStreamObserver<RunQueryResponse> runQueryResponseObserver, long startTimeNanos, ByteString transactionId, Timestamp readTime, ExplainOptions explainOptions, boolean isRetryRequestWithCursor)
Parameters | |
---|---|
Name | Description |
runQueryResponseObserver |
ApiStreamObserver<RunQueryResponse> |
startTimeNanos |
long |
transactionId |
ByteString |
readTime |
com.google.cloud.Timestamp |
explainOptions |
ExplainOptions |
isRetryRequestWithCursor |
boolean |