Package com.linkedin.venice.writer
Class CompletableFutureCallback
- java.lang.Object
-
- com.linkedin.venice.writer.CompletableFutureCallback
-
- All Implemented Interfaces:
Measurable
,PubSubProducerCallback
public class CompletableFutureCallback extends java.lang.Object implements PubSubProducerCallback, Measurable
Compose a CompletableFuture and Callback together to be aCompletableFutureCallback
type. When theCompletableFutureCallback
is called, theCompletableFuture
internal state will be changed and the callback will be called. The caller can pass aCompletableFutureCallback
to a function accepting aCallback
parameter to get aCompletableFuture
after the function returns.
-
-
Constructor Summary
Constructors Constructor Description CompletableFutureCallback(java.util.concurrent.CompletableFuture<java.lang.Void> completableFuture)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PubSubProducerCallback
getCallback()
int
getHeapSize()
void
onCompletion(PubSubProduceResult produceResult, java.lang.Exception e)
exception will be null if request was completed without an error.void
setCallback(PubSubProducerCallback callback)
-
-
-
Method Detail
-
onCompletion
public void onCompletion(PubSubProduceResult produceResult, java.lang.Exception e)
Description copied from interface:PubSubProducerCallback
exception will be null if request was completed without an error.- Specified by:
onCompletion
in interfacePubSubProducerCallback
-
getCallback
public PubSubProducerCallback getCallback()
-
setCallback
public void setCallback(PubSubProducerCallback callback)
-
getHeapSize
public int getHeapSize()
- Specified by:
getHeapSize
in interfaceMeasurable
-
-