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 TypeMethodDescriptionintvoidonCompletion(PubSubProduceResult produceResult, Exception e) exception will be null if request was completed without an error.voidsetInternalCallback(PubSubProducerCallback callback) Add internal callback into the current callback.
-
Constructor Details
-
CompletableFutureCallback
-
-
Method Details
-
onCompletion
Description copied from interface:PubSubProducerCallbackexception will be null if request was completed without an error.- Specified by:
onCompletionin interfacePubSubProducerCallback
-
getCallback
-
setInternalCallback
Description copied from interface:PubSubProducerCallbackAdd internal callback into the current callback. Default behavior is doing nothing.- Specified by:
setInternalCallbackin interfacePubSubProducerCallback
-
getCompletableFuture
-
getHeapSize
public int getHeapSize()- Specified by:
getHeapSizein interfaceMeasurable
-