Package com.linkedin.venice.writer
Class CompletableFutureCallback
java.lang.Object
com.linkedin.venice.writer.CompletableFutureCallback
- All Implemented Interfaces:
Measurable
,PubSubProducerCallback
Compose a CompletableFuture and Callback together to be a
CompletableFutureCallback
type.
When the CompletableFutureCallback
is called, the CompletableFuture
internal state will be
changed and the callback will be called. The caller can pass a CompletableFutureCallback
to a function
accepting a Callback
parameter to get a CompletableFuture
after the function returns.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
void
onCompletion
(PubSubProduceResult produceResult, Exception e) exception will be null if request was completed without an error.void
setInternalCallback
(PubSubProducerCallback callback) Add internal callback into the current callback.
-
Constructor Details
-
CompletableFutureCallback
-
-
Method Details
-
onCompletion
Description copied from interface:PubSubProducerCallback
exception will be null if request was completed without an error.- Specified by:
onCompletion
in interfacePubSubProducerCallback
-
getCallback
-
setInternalCallback
Description copied from interface:PubSubProducerCallback
Add internal callback into the current callback. Default behavior is doing nothing.- Specified by:
setInternalCallback
in interfacePubSubProducerCallback
-
getCompletableFuture
-
getHeapSize
public int getHeapSize()- Specified by:
getHeapSize
in interfaceMeasurable
-