Package com.linkedin.venice.writer
Class ChainedPubSubCallback
java.lang.Object
com.linkedin.venice.writer.ChainedPubSubCallback
- All Implemented Interfaces:
PubSubProducerCallback
This class bundles a main
PubSubProducerCallback
and a list of dependent PubSubProducerCallback
.
When it completes either successfully or exceptionally, it will pass on the same result to the main callback and the
list of the dependent callbacks.
This class is intended to be used inside BatchingVeniceWriter
for compacting buffered messages with the same key.-
Constructor Summary
ConstructorsConstructorDescriptionChainedPubSubCallback
(PubSubProducerCallback mainCallback, List<PubSubProducerCallback> dependentCallbackList) -
Method Summary
Modifier and TypeMethodDescriptionvoid
onCompletion
(PubSubProduceResult produceResult, Exception exception) exception will be null if request was completed without an error.void
setInternalCallback
(PubSubProducerCallback internalCallback) Insert an internalPubSubProducerCallback
to main callback and the dependent callbacks.
-
Constructor Details
-
ChainedPubSubCallback
public ChainedPubSubCallback(PubSubProducerCallback mainCallback, List<PubSubProducerCallback> dependentCallbackList)
-
-
Method Details
-
onCompletion
Description copied from interface:PubSubProducerCallback
exception will be null if request was completed without an error.- Specified by:
onCompletion
in interfacePubSubProducerCallback
-
setInternalCallback
Insert an internalPubSubProducerCallback
to main callback and the dependent callbacks.- Specified by:
setInternalCallback
in interfacePubSubProducerCallback
-