Evaluate a query plan (core method).
As explained in some depth at
BlockingBuffer.close() does not unblock threads and Semantics of interrupting a
running query, (a) you can not interrupted the thread that submits a
query until the
CloseableIteration has been returned to the
caller submitting that query; (b)
(a) If you interrupt the thread submitting the query, the query may
actually execute. This can occur because the interrupt can arise between
the time at which the query begins to execute on the
QueryEngineand the time at which the
IRunningQuery object is bound up inside
of the returned
CloseableIteration and returned to the caller.
Until the caller has possession of the
CloseableIteration, an
interrupt will not cause the associated
IRunningQuery to be
terminated. See
BlockingBuffer.close() does not unblock threads
(b) If you interrupt the thread draining the solutions from the
CloseableIteration or otherwise cause
CloseableIteration#close() to become invoked, then the
IRunningQuery will be interrupted. Per Semantics of interrupting a
running query, that interrupt is interpreted as normal
termination (this supports the use case of LIMIT and is built deeply into
the
QueryEngine semantics). In order for the application to
distinguish between a case where it has interrupted the query and a case
where the query has been interrupted by a LIMIT, the application MUST
notice when it decides to interrupt a given query and then discard the
outcome of that query.