Package com.couchbase.client.java.query
Interface N1qlQueryResult
- All Superinterfaces:
Iterable<N1qlQueryRow>
- All Known Implementing Classes:
DefaultN1qlQueryResult
@Committed @Public public interface N1qlQueryResult extends Iterable<N1qlQueryRow>
Represents the results of a
N1qlQuery
, in a blocking fashion.
Note that the result is complete, meaning it will block until all
data has been streamed from the server.- Since:
- 2.0.0
- Author:
- Michael Nitschinger
-
Method Summary
Modifier and Type Method Description List<N1qlQueryRow>
allRows()
String
clientContextId()
List<JsonObject>
errors()
boolean
finalSuccess()
Denotes the success or failure of the query.N1qlMetrics
info()
boolean
parseSuccess()
JsonObject
profileInfo()
String
requestId()
Iterator<N1qlQueryRow>
rows()
Object
signature()
String
status()
Returns the final status of the query.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
allRows
List<N1qlQueryRow> allRows()- Returns:
- the list of all
N1qlQueryRow
, the results of the query, if successful.
-
rows
Iterator<N1qlQueryRow> rows()- Returns:
- an iterator over the list of all
N1qlQueryRow
, the results of the query, if successful.
-
signature
Object signature()- Returns:
- an object 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
N1qlMetrics info()- Returns:
- an object describing some metrics/info about the execution of the query.
-
profileInfo
JsonObject profileInfo()- Returns:
- an object describing some profiling info about the execution of the query.
-
parseSuccess
boolean parseSuccess()- Returns:
- true if the query could be parsed, false if it short-circuited due to syntax/fatal error.
-
finalSuccess
boolean finalSuccess()Denotes the success or failure of the query. It could fail slower than withparseSuccess()
, for example if a fatal error comes up while streaming the results to the client. This method blocks until the query is over and the success can be established. -
status
String status()Returns the final status of the query. For example, a successful query will return "success
" (which is equivalent tofinalSuccess()
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. This method blocks until the query is over and the status can be established. -
errors
List<JsonObject> errors()- Returns:
- A list of errors or warnings encountered while executing the query.
-
requestId
String requestId()- Returns:
- the requestId generated by the server
-
clientContextId
String clientContextId()- Returns:
- the clientContextId that was set by the client (could be truncated to 64 bytes of UTF-8 chars)
-