Package org.apache.drill.exec.rpc.user
Class BlockingResultsListener
java.lang.Object
org.apache.drill.exec.rpc.user.BlockingResultsListener
- All Implemented Interfaces:
UserResultsListener
-
Constructor Summary
ConstructorDescriptionBlockingResultsListener
(Supplier<org.apache.drill.shaded.guava.com.google.common.base.Stopwatch> elapsedTimer, Supplier<Long> timeoutInMilliseconds, int batchQueueThrottlingThreshold) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
close()
void
dataArrived
(QueryDataBatch result, ConnectionThrottle throttle) AQueryData
message was receivedgetNext()
Gets the next batch of query results from the queue.boolean
void
The query has completed (successful completion or cancellation).void
queryIdArrived
(UserBitShared.QueryId queryId) QueryId is available.void
The query has failed.
-
Constructor Details
-
BlockingResultsListener
-
-
Method Details
-
awaitFirstMessage
-
submissionFailed
Description copied from interface:UserResultsListener
The query has failed. Most likely called when the server returns a FAILED query state. Can also be called ifdataArrived()
throws an exception- Specified by:
submissionFailed
in interfaceUserResultsListener
- Parameters:
ex
- exception describing the cause of the failure
-
dataArrived
Description copied from interface:UserResultsListener
AQueryData
message was received- Specified by:
dataArrived
in interfaceUserResultsListener
- Parameters:
result
- data batch receivedthrottle
- connection throttle
-
getQueryId
-
getNext
Gets the next batch of query results from the queue.- Returns:
- the next batch, or
null
after last batch has been returned - Throws:
UserException
- if the query failedInterruptedException
- if waiting on the queue was interruptedSQLTimeoutException
-
close
public void close() -
isCompleted
public boolean isCompleted()
-