public abstract class SingleRowListener
extends java.lang.Object
implements org.apache.drill.exec.rpc.user.UserResultsListener
| Constructor and Description |
|---|
SingleRowListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Clean up any resources used.
|
void |
dataArrived(org.apache.drill.exec.rpc.user.QueryDataBatch result,
org.apache.drill.exec.rpc.ConnectionThrottle throttle)
A
QueryData message was received |
java.util.List<org.apache.drill.exec.proto.UserBitShared.DrillPBError> |
getErrorList()
Get an immutable copy of the list of all errors received so far.
|
org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState |
getQueryState()
Get the last known QueryState.
|
void |
queryCompleted(org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState state)
The query has completed (successsful completion or cancellation).
|
void |
queryIdArrived(org.apache.drill.exec.proto.UserBitShared.QueryId queryId)
QueryId is available.
|
protected abstract void |
rowArrived(org.apache.drill.exec.rpc.user.QueryDataBatch queryDataBatch)
A record has arrived and is ready for access.
|
void |
submissionFailed(org.apache.drill.common.exceptions.UserException ex)
The query has failed.
|
void |
waitForCompletion()
Wait for the completion of this query; receiving a record or an error will both cause the
query to be considered complete
|
public void queryIdArrived(org.apache.drill.exec.proto.UserBitShared.QueryId queryId)
org.apache.drill.exec.rpc.user.UserResultsListenerqueryIdArrived in interface org.apache.drill.exec.rpc.user.UserResultsListenerqueryId - sent by the server along Acks.OKpublic void submissionFailed(org.apache.drill.common.exceptions.UserException ex)
org.apache.drill.exec.rpc.user.UserResultsListenerdataArrived() throws an exceptionsubmissionFailed in interface org.apache.drill.exec.rpc.user.UserResultsListenerex - exception describing the cause of the failurepublic void queryCompleted(org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState state)
org.apache.drill.exec.rpc.user.UserResultsListenerqueryCompleted in interface org.apache.drill.exec.rpc.user.UserResultsListenerpublic void dataArrived(org.apache.drill.exec.rpc.user.QueryDataBatch result,
org.apache.drill.exec.rpc.ConnectionThrottle throttle)
org.apache.drill.exec.rpc.user.UserResultsListenerQueryData message was receiveddataArrived in interface org.apache.drill.exec.rpc.user.UserResultsListenerresult - data batch receivedthrottle - connection throttlepublic org.apache.drill.exec.proto.UserBitShared.QueryResult.QueryState getQueryState()
public java.util.List<org.apache.drill.exec.proto.UserBitShared.DrillPBError> getErrorList()
protected abstract void rowArrived(org.apache.drill.exec.rpc.user.QueryDataBatch queryDataBatch)
Derived classes provide whatever implementation they require here to access the record's data.
queryDataBatch - result batch holding the rowpublic void waitForCompletion()
throws java.lang.Exception
java.lang.Exception - if there was any kind of problempublic void cleanup()
Derived classes may use this to free things like allocators or files that were used to record data received in resultArrived().