Class GenericAnalyticsResponse
- java.lang.Object
-
- com.couchbase.client.core.message.AbstractCouchbaseResponse
-
- com.couchbase.client.core.message.analytics.GenericAnalyticsResponse
-
- All Implemented Interfaces:
CouchbaseMessage
,CouchbaseResponse
@Uncommitted @Public public class GenericAnalyticsResponse extends AbstractCouchbaseResponse
The base response for Analytics (SQL++) requests. Response is divided into sub-sections, each of which can be asynchronously fed. They are represented asObservable
, most of them ofByteBuf
. Note that it is important that these streams are consumed and their ByteBuf released. In order to reuse the values of a section but still correctly release the ByteBuf, the best is to convert them into an appropriate gc-able value, release the buffer and cache the resulting stream. If one isn't interested in a particular sub-section, it should still be released by subscribing aBuffers.BYTE_BUF_RELEASER
to its stream.
-
-
Constructor Summary
Constructors Constructor Description GenericAnalyticsResponse(rx.Observable<ByteBuf> errors, rx.Observable<ByteBuf> rows, rx.Observable<ByteBuf> signature, rx.Observable<String> queryStatus, rx.Observable<ByteBuf> info, String handle, CouchbaseRequest request, ResponseStatus status, String requestId, String clientRequestId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
clientRequestId()
rx.Observable<ByteBuf>
errors()
If there were errors and/or warnings while executing the query, contains aByteBuf
for each error and each warning.String
handle()
Contains the deferred handle urlrx.Observable<ByteBuf>
info()
Contains a singleByteBuf
representing the JSON object of query execution metrics (or empty if metrics haven't been activated).rx.Observable<String>
queryStatus()
Contains a single String denoting the status of the query (success, running, errors, completed, stopped, timeout, fatal).String
requestId()
rx.Observable<ByteBuf>
rows()
Contains oneByteBuf
for each result item returned by the server.rx.Observable<ByteBuf>
signature()
Contains a singleByteBuf
representing the Analytics json signature of the results.-
Methods inherited from class com.couchbase.client.core.message.AbstractCouchbaseResponse
creationTime, request, status, statusDetails, statusDetails, toString
-
-
-
-
Constructor Detail
-
GenericAnalyticsResponse
public GenericAnalyticsResponse(rx.Observable<ByteBuf> errors, rx.Observable<ByteBuf> rows, rx.Observable<ByteBuf> signature, rx.Observable<String> queryStatus, rx.Observable<ByteBuf> info, String handle, CouchbaseRequest request, ResponseStatus status, String requestId, String clientRequestId)
-
-
Method Detail
-
rows
public rx.Observable<ByteBuf> rows()
Contains oneByteBuf
for each result item returned by the server. Each item is a JSON object.
-
signature
public rx.Observable<ByteBuf> signature()
Contains a singleByteBuf
representing the Analytics json signature of the results. May not appear at all if there are no results (in case of fatal errors for example).
-
errors
public rx.Observable<ByteBuf> errors()
If there were errors and/or warnings while executing the query, contains aByteBuf
for each error and each warning. These are JSON objects, that should at least contain a 'msg' and a 'code'.
-
queryStatus
public rx.Observable<String> queryStatus()
-
info
public rx.Observable<ByteBuf> info()
Contains a singleByteBuf
representing the JSON object of query execution metrics (or empty if metrics haven't been activated).
-
requestId
public String requestId()
- Returns:
- the UUID for this request, can be used on the server side for tracing.
-
clientRequestId
public String clientRequestId()
- Returns:
- the client-provided identifier if provided in the request, empty string otherwise.
-
handle
public String handle()
Contains the deferred handle url
-
-