public abstract class SingleRowListener extends Object implements UserResultsListener
rowArrived(QueryDataBatch) provides
the means for a derived class to get the expected record's data.| Constructor and Description |
|---|
SingleRowListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Clean up any resources used.
|
void |
dataArrived(QueryDataBatch result,
ConnectionThrottle throttle)
A
QueryData message was received |
List<UserBitShared.DrillPBError> |
getErrorList()
Get an immutable copy of the list of all errors received so far.
|
UserBitShared.QueryResult.QueryState |
getQueryState()
Get the last known QueryState.
|
void |
queryCompleted(UserBitShared.QueryResult.QueryState state)
The query has completed (successful completion or cancellation).
|
void |
queryIdArrived(UserBitShared.QueryId queryId)
QueryId is available.
|
protected abstract void |
rowArrived(QueryDataBatch queryDataBatch)
A record has arrived and is ready for access.
|
void |
submissionFailed(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(UserBitShared.QueryId queryId)
UserResultsListenerqueryIdArrived in interface UserResultsListenerqueryId - sent by the server along Acks.OKpublic void submissionFailed(UserException ex)
UserResultsListenerdataArrived()
throws an exceptionsubmissionFailed in interface UserResultsListenerex - exception describing the cause of the failurepublic void queryCompleted(UserBitShared.QueryResult.QueryState state)
UserResultsListenerqueryCompleted in interface UserResultsListenerpublic void dataArrived(QueryDataBatch result, ConnectionThrottle throttle)
UserResultsListenerQueryData message was receiveddataArrived in interface UserResultsListenerresult - data batch receivedthrottle - connection throttlepublic UserBitShared.QueryResult.QueryState getQueryState()
public List<UserBitShared.DrillPBError> getErrorList()
protected abstract void rowArrived(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 Exception
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().
Copyright © 2021 The Apache Software Foundation. All rights reserved.