Package com.couchbase.client.java.query
Class DefaultAsyncN1qlQueryResult
java.lang.Object
com.couchbase.client.java.query.DefaultAsyncN1qlQueryResult
- All Implemented Interfaces:
AsyncN1qlQueryResult
@Committed @Public public class DefaultAsyncN1qlQueryResult extends Object implements AsyncN1qlQueryResult
The default implementation of an
AsyncN1qlQueryResult
.- Author:
- Michael Nitschinger
-
Constructor Summary
Constructors Constructor Description DefaultAsyncN1qlQueryResult(rx.Observable<AsyncN1qlQueryRow> rows, rx.Observable<Object> signature, rx.Observable<N1qlMetrics> info, rx.Observable<JsonObject> errors, rx.Observable<JsonObject> profileInfo, rx.Observable<String> finalStatus, boolean parsingSuccess, String requestId, String clientContextId)
-
Method Summary
Modifier and Type Method Description String
clientContextId()
rx.Observable<JsonObject>
errors()
rx.Observable<Boolean>
finalSuccess()
Asynchronously denotes the success or failure of the query.rx.Observable<N1qlMetrics>
info()
boolean
parseSuccess()
Immediately denotes initial parsing success of the query.rx.Observable<JsonObject>
profileInfo()
String
requestId()
rx.Observable<AsyncN1qlQueryRow>
rows()
rx.Observable<Object>
signature()
rx.Observable<String>
status()
Asynchronously returns the final status of the query.
-
Constructor Details
-
DefaultAsyncN1qlQueryResult
public DefaultAsyncN1qlQueryResult(rx.Observable<AsyncN1qlQueryRow> rows, rx.Observable<Object> signature, rx.Observable<N1qlMetrics> info, rx.Observable<JsonObject> errors, rx.Observable<JsonObject> profileInfo, rx.Observable<String> finalStatus, boolean parsingSuccess, String requestId, String clientContextId)
-
-
Method Details
-
rows
- Specified by:
rows
in interfaceAsyncN1qlQueryResult
- Returns:
- an async stream of each row resulting from the query (empty if fatal errors occurred).
-
signature
- Specified by:
signature
in interfaceAsyncN1qlQueryResult
- 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
- Specified by:
info
in interfaceAsyncN1qlQueryResult
- Returns:
- an async single item describing some metrics/info about the execution of the query.
-
profileInfo
- Specified by:
profileInfo
in interfaceAsyncN1qlQueryResult
- Returns:
- an async single item describing some profiling info about the execution of the query.
-
finalSuccess
Description copied from interface:AsyncN1qlQueryResult
Asynchronously denotes the success or failure of the query. It could fail slower than withAsyncN1qlQueryResult.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:
finalSuccess
in interfaceAsyncN1qlQueryResult
-
status
Description copied from interface:AsyncN1qlQueryResult
Asynchronously returns the final status of the query. For example, a successful query will return "success
" (which is equivalent toAsyncN1qlQueryResult.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:
status
in interfaceAsyncN1qlQueryResult
-
parseSuccess
public boolean parseSuccess()Description copied from interface:AsyncN1qlQueryResult
Immediately denotes initial parsing success of the query. As rows are processed, it could be that a late failure occurs. SeeAsyncN1qlQueryResult.finalSuccess()
for the end of processing status.- Specified by:
parseSuccess
in interfaceAsyncN1qlQueryResult
- Returns:
- true if the query could be parsed, false if it short-circuited due to syntax/fatal error.
-
errors
- Specified by:
errors
in interfaceAsyncN1qlQueryResult
- Returns:
- an async stream of errors or warnings encountered while executing the query.
-
requestId
- Specified by:
requestId
in interfaceAsyncN1qlQueryResult
- Returns:
- the requestId generated by the server
-
clientContextId
- Specified by:
clientContextId
in interfaceAsyncN1qlQueryResult
- Returns:
- the clientContextId that was set by the client (could be truncated to 64 bytes of UTF-8 chars)
-