java.lang.Object
org.apache.arrow.flight.AsyncPutListener
- All Implemented Interfaces:
FlightClient.PutListener,FlightProducer.StreamListener<PutResult>
A handler for server-sent application metadata messages during a Flight DoPut operation.
To handle messages, create an instance of this class overriding onNext(PutResult).
The other methods should not be overridden.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidWait for the stream to finish on the server side.booleanCheck if the call has been cancelled.final voidIndicate that the transmission is finished.final voidIndicate an error to the client.voidCalled when a message from the server is received.
-
Constructor Details
-
AsyncPutListener
public AsyncPutListener()
-
-
Method Details
-
getResult
public final void getResult()Wait for the stream to finish on the server side. You must call this to be notified of any errors that may have happened during the upload.- Specified by:
getResultin interfaceFlightClient.PutListener
-
onNext
Description copied from interface:FlightClient.PutListenerCalled when a message from the server is received.- Specified by:
onNextin interfaceFlightClient.PutListener- Specified by:
onNextin interfaceFlightProducer.StreamListener<PutResult>- Parameters:
val- The application metadata. This buffer will be reclaimed once onNext returns; you must retain a reference to use it outside this method.
-
onError
Description copied from interface:FlightProducer.StreamListenerIndicate an error to the client.Terminates the stream; do not call
FlightProducer.StreamListener.onCompleted().- Specified by:
onErrorin interfaceFlightProducer.StreamListener<PutResult>
-
onCompleted
public final void onCompleted()Description copied from interface:FlightProducer.StreamListenerIndicate that the transmission is finished.- Specified by:
onCompletedin interfaceFlightProducer.StreamListener<PutResult>
-
isCancelled
public boolean isCancelled()Description copied from interface:FlightClient.PutListenerCheck if the call has been cancelled.By default, this always returns false. Implementations should provide an appropriate implementation, as otherwise, a DoPut operation may inadvertently block forever.
- Specified by:
isCancelledin interfaceFlightClient.PutListener
-