public final class SyncPutListener extends Object implements FlightClient.PutListener, AutoCloseable
| Constructor and Description |
|---|
SyncPutListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
getResult()
Wait for the stream to finish on the server side.
|
boolean |
isCancelled()
Check if the call has been cancelled.
|
void |
onCompleted()
Indicate that the transmission is finished.
|
void |
onError(Throwable t)
Indicate an error to the client.
|
void |
onNext(PutResult val)
Called when a message from the server is received.
|
PutResult |
poll(long timeout,
TimeUnit unit)
Get the next message from the server, blocking for the specified amount of time until it is available.
|
PutResult |
read()
Get the next message from the server, blocking until it is available.
|
public PutResult read() throws InterruptedException, ExecutionException
InterruptedException - if interrupted while waiting.ExecutionException - if the server sent an error, or if there was an internal error.public PutResult poll(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException
InterruptedException - if interrupted while waiting.ExecutionException - if the server sent an error, or if there was an internal error.public void getResult()
FlightClient.PutListenergetResult in interface FlightClient.PutListenerpublic void onNext(PutResult val)
FlightClient.PutListeneronNext in interface FlightClient.PutListeneronNext in interface FlightProducer.StreamListener<PutResult>val - The application metadata. This buffer will be reclaimed once onNext returns; you must retain a
reference to use it outside this method.public void onError(Throwable t)
FlightProducer.StreamListenerTerminates the stream; do not call FlightProducer.StreamListener.onCompleted().
onError in interface FlightProducer.StreamListener<PutResult>public void onCompleted()
FlightProducer.StreamListeneronCompleted in interface FlightProducer.StreamListener<PutResult>public void close()
close in interface AutoCloseablepublic boolean isCancelled()
FlightClient.PutListenerBy default, this always returns false. Implementations should provide an appropriate implementation, as otherwise, a DoPut operation may inadvertently block forever.
isCancelled in interface FlightClient.PutListenerCopyright © 2021 The Apache Software Foundation. All rights reserved.