Class OnlineQueryMultiResult
- All Implemented Interfaces:
AutoCloseable
Closing this object closes every sub-result and releases all Arrow
memory associated with the request. Callers should use try-with-resources
and should not close the individual OnlineQueryResults
returned by getResults().
-
Constructor Summary
ConstructorsConstructorDescriptionOnlineQueryMultiResult(List<OnlineQueryResult> results, ServerError[] globalErrors, String traceId) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()close releases the resources associated with every sub-result.globalErrors holds the errors that the engine did not attach to a specific sub-query's result.results holds oneOnlineQueryResultper sub-query, in the same order the queries were passed in.traceId is the trace ID of the single underlying request, and is therefore shared by every sub-query.
-
Constructor Details
-
OnlineQueryMultiResult
public OnlineQueryMultiResult(List<OnlineQueryResult> results, ServerError[] globalErrors, @Nullable String traceId)
-
-
Method Details
-
close
public void close()close releases the resources associated with every sub-result. It is idempotent. If closing a sub-result fails, the remaining sub-results are still closed and the first failure is thrown with the rest attached as suppressed exceptions.- Specified by:
closein interfaceAutoCloseable
-
getResults
results holds oneOnlineQueryResultper sub-query, in the same order the queries were passed in. Errors that pertain to a specific sub-query are found on that sub-query's result, viaOnlineQueryResult.getErrors().Each result owns its own Arrow allocator, which is released when this object is closed.
This list is 1:1 with the queries that were submitted, with one exception: if the request failed before any sub-query was dispatched, this list is empty and
getGlobalErrors()explains why. -
getGlobalErrors
globalErrors holds the errors that the engine did not attach to a specific sub-query's result. A resolver that fails while computing a sub-query is reported on that sub-query's own result instead, so most errors are not global.An error here is not necessarily unrelated to a particular sub-query. When a sub-query fails to execute at all -- it was rate limited, or the engine hit a transport or internal error running it -- the engine records the failure here and names the sub-query by its 1-based position in the message text, e.g.
"... while executing query 2/3: ...". That sub-query still occupies its slot ingetResults(), but the result is empty and reports no errors of its own. So an empty result is not proof of success: check this list too before concluding that every sub-query ran. -
getTraceId
traceId is the trace ID of the single underlying request, and is therefore shared by every sub-query.
-