Package org.apache.arrow.flight
Class AsyncPutListener
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
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Wait for the stream to finish on the server side.boolean
Check if the call has been cancelled.final void
Indicate that the transmission is finished.final void
Indicate an error to the client.void
Called 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:
getResult
in interfaceFlightClient.PutListener
-
onNext
Description copied from interface:FlightClient.PutListener
Called when a message from the server is received.- Specified by:
onNext
in interfaceFlightClient.PutListener
- Specified by:
onNext
in 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.StreamListener
Indicate an error to the client.Terminates the stream; do not call
FlightProducer.StreamListener.onCompleted()
.- Specified by:
onError
in interfaceFlightProducer.StreamListener<PutResult>
-
onCompleted
public final void onCompleted()Description copied from interface:FlightProducer.StreamListener
Indicate that the transmission is finished.- Specified by:
onCompleted
in interfaceFlightProducer.StreamListener<PutResult>
-
isCancelled
public boolean isCancelled()Description copied from interface:FlightClient.PutListener
Check 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:
isCancelled
in interfaceFlightClient.PutListener
-