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
-
Method Summary
Modifier and TypeMethodDescriptionint
void
onCompletion
(PubSubProduceResult produceResult, Exception e) exception will be null if request was completed without an error.void
setCallback
(PubSubProducerCallback 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
-
setCallback
-
getHeapSize
public int getHeapSize()- Specified by:
getHeapSize
in interfaceMeasurable
-