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
ConstructorsConstructorDescriptionBlockingResultsListener(Supplier<com.google.common.base.Stopwatch> elapsedTimer, Supplier<Long> timeoutInMilliseconds, int batchQueueThrottlingThreshold) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()voiddataArrived(QueryDataBatch result, ConnectionThrottle throttle) Amessage was receivedinvalid reference
QueryDatagetNext()Gets the next batch of query results from the queue.booleanvoidThe query has completed (successful completion or cancellation).voidqueryIdArrived(UserBitShared.QueryId queryId) QueryId is available.voidThe query has failed.
-
Constructor Details
-
BlockingResultsListener
-
-
Method Details
-
awaitFirstMessage
-
submissionFailed
Description copied from interface:UserResultsListenerThe query has failed. Most likely called when the server returns a FAILED query state. Can also be called ifdataArrived()throws an exception- Specified by:
submissionFailedin interfaceUserResultsListener- Parameters:
ex- exception describing the cause of the failure
-
dataArrived
Description copied from interface:UserResultsListenerAmessage was receivedinvalid reference
QueryData- Specified by:
dataArrivedin 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
nullafter 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()
-