Class DefaultAsyncAnalyticsQueryResult
- java.lang.Object
-
- com.couchbase.client.java.analytics.DefaultAsyncAnalyticsQueryResult
-
- All Implemented Interfaces:
AsyncAnalyticsQueryResult
@Committed @Public public class DefaultAsyncAnalyticsQueryResult extends Object implements AsyncAnalyticsQueryResult
-
-
Constructor Summary
Constructors Constructor Description DefaultAsyncAnalyticsQueryResult(AsyncAnalyticsDeferredResultHandle handle, rx.Observable<Object> signature, rx.Observable<AnalyticsMetrics> info, rx.Observable<JsonObject> errors, rx.Observable<String> finalStatus, boolean parsingSuccess, String requestId, String clientContextId)DefaultAsyncAnalyticsQueryResult(rx.Observable<AsyncAnalyticsQueryRow> rows, rx.Observable<Object> signature, rx.Observable<AnalyticsMetrics> info, rx.Observable<JsonObject> errors, rx.Observable<String> finalStatus, boolean parsingSuccess, String requestId, String clientContextId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringclientContextId()rx.Observable<JsonObject>errors()rx.Observable<Boolean>finalSuccess()Asynchronously denotes the success or failure of the query.AsyncAnalyticsDeferredResultHandlehandle()rx.Observable<AnalyticsMetrics>info()booleanparseSuccess()Immediately denotes initial parsing success of the query.StringrequestId()rx.Observable<AsyncAnalyticsQueryRow>rows()rx.Observable<Object>signature()rx.Observable<String>status()Asynchronously returns the final status of the query.
-
-
-
Constructor Detail
-
DefaultAsyncAnalyticsQueryResult
public DefaultAsyncAnalyticsQueryResult(rx.Observable<AsyncAnalyticsQueryRow> rows, rx.Observable<Object> signature, rx.Observable<AnalyticsMetrics> info, rx.Observable<JsonObject> errors, rx.Observable<String> finalStatus, boolean parsingSuccess, String requestId, String clientContextId)
-
DefaultAsyncAnalyticsQueryResult
public DefaultAsyncAnalyticsQueryResult(AsyncAnalyticsDeferredResultHandle handle, rx.Observable<Object> signature, rx.Observable<AnalyticsMetrics> info, rx.Observable<JsonObject> errors, rx.Observable<String> finalStatus, boolean parsingSuccess, String requestId, String clientContextId)
-
-
Method Detail
-
rows
public rx.Observable<AsyncAnalyticsQueryRow> rows()
- Specified by:
rowsin interfaceAsyncAnalyticsQueryResult- Returns:
- an async stream of each row resulting from the query (empty if fatal errors occurred).
-
signature
public rx.Observable<Object> signature()
- Specified by:
signaturein interfaceAsyncAnalyticsQueryResult- Returns:
- an async single-item representing the signature of the results, that can be used to
learn about the common structure of each
row. This signature is usually aJsonObject, but could also be any JSON-valid type like a boolean scalar,JsonArray...
-
info
public rx.Observable<AnalyticsMetrics> info()
- Specified by:
infoin interfaceAsyncAnalyticsQueryResult- Returns:
- an async single item describing some metrics/info about the execution of the query.
-
finalSuccess
public rx.Observable<Boolean> finalSuccess()
Description copied from interface:AsyncAnalyticsQueryResultAsynchronously denotes the success or failure of the query. It could fail slower than withAsyncAnalyticsQueryResult.parseSuccess(), for example if a fatal error comes up while streaming the results to the client. Receiving a (single) value for finalSuccess means the query is over.- Specified by:
finalSuccessin interfaceAsyncAnalyticsQueryResult
-
status
public rx.Observable<String> status()
Description copied from interface:AsyncAnalyticsQueryResultAsynchronously returns the final status of the query. For example, a successful query will return "success" (which is equivalent toAsyncAnalyticsQueryResult.finalSuccess()returning true). Other statuses include (but are not limited to) "fatal" when fatal errors occurred and "timeout" when the query timed out on the server side but not yet on the client side. Receiving a (single) value for status means the query is over.- Specified by:
statusin interfaceAsyncAnalyticsQueryResult
-
parseSuccess
public boolean parseSuccess()
Description copied from interface:AsyncAnalyticsQueryResultImmediately denotes initial parsing success of the query. As rows are processed, it could be that a late failure occurs. SeeAsyncAnalyticsQueryResult.finalSuccess()for the end of processing status.- Specified by:
parseSuccessin interfaceAsyncAnalyticsQueryResult- Returns:
- true if the query could be parsed, false if it short-circuited due to syntax/fatal error.
-
errors
public rx.Observable<JsonObject> errors()
- Specified by:
errorsin interfaceAsyncAnalyticsQueryResult- Returns:
- an async stream of errors or warnings encountered while executing the query.
-
requestId
public String requestId()
- Specified by:
requestIdin interfaceAsyncAnalyticsQueryResult- Returns:
- the requestId generated by the server
-
clientContextId
public String clientContextId()
- Specified by:
clientContextIdin interfaceAsyncAnalyticsQueryResult- Returns:
- the clientContextId that was set by the client (could be truncated to 64 bytes of UTF-8 chars)
-
handle
public AsyncAnalyticsDeferredResultHandle handle()
- Specified by:
handlein interfaceAsyncAnalyticsQueryResult- Returns:
- the
AsyncAnalyticsDeferredResultHandlefor deferred result fetch
-
-