Package com.linkedin.venice.pubsub.api
Class PubSubProducerAdapterDelegator
- java.lang.Object
-
- com.linkedin.venice.pubsub.api.PubSubProducerAdapterDelegator
-
- All Implemented Interfaces:
PubSubProducerAdapter
public class PubSubProducerAdapterDelegator extends java.lang.Object implements PubSubProducerAdapter
-
-
Constructor Summary
Constructors Constructor Description PubSubProducerAdapterDelegator(java.util.List<PubSubProducerAdapter> producers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close(long closeTimeOutMs)
void
flush()
java.lang.String
getBrokerAddress()
it.unimi.dsi.fastutil.objects.Object2DoubleMap<java.lang.String>
getMeasurableProducerMetrics()
int
getNumberOfPartitions(java.lang.String topic)
The support for the following two getNumberOfPartitions APIs will be removed.java.util.concurrent.CompletableFuture<PubSubProduceResult>
sendMessage(java.lang.String topic, java.lang.Integer partition, KafkaKey key, KafkaMessageEnvelope value, PubSubMessageHeaders pubSubMessageHeaders, PubSubProducerCallback pubSubProducerCallback)
Sends a message to a PubSub topic asynchronously and returns aFuture
representing the result of the produce operation.
-
-
-
Constructor Detail
-
PubSubProducerAdapterDelegator
public PubSubProducerAdapterDelegator(java.util.List<PubSubProducerAdapter> producers)
-
-
Method Detail
-
getNumberOfPartitions
public int getNumberOfPartitions(java.lang.String topic)
Description copied from interface:PubSubProducerAdapter
The support for the following two getNumberOfPartitions APIs will be removed.- Specified by:
getNumberOfPartitions
in interfacePubSubProducerAdapter
-
sendMessage
public java.util.concurrent.CompletableFuture<PubSubProduceResult> sendMessage(java.lang.String topic, java.lang.Integer partition, KafkaKey key, KafkaMessageEnvelope value, PubSubMessageHeaders pubSubMessageHeaders, PubSubProducerCallback pubSubProducerCallback)
Description copied from interface:PubSubProducerAdapter
Sends a message to a PubSub topic asynchronously and returns aFuture
representing the result of the produce operation.- Specified by:
sendMessage
in interfacePubSubProducerAdapter
- Parameters:
topic
- The name of the Kafka topic to which the message will be sent.partition
- The partition to which the message should be sent.key
- The key associated with the message, used for partitioning and message retrieval.value
- The message payload to be sent to the PubSubTopic topic.pubSubMessageHeaders
- Additional headers to be included with the message.pubSubProducerCallback
- An optional callback to handle the result of the produce operation.- Returns:
- A
Future
representing the result of the produce operation.
-
flush
public void flush()
- Specified by:
flush
in interfacePubSubProducerAdapter
-
close
public void close(long closeTimeOutMs)
- Specified by:
close
in interfacePubSubProducerAdapter
-
getMeasurableProducerMetrics
public it.unimi.dsi.fastutil.objects.Object2DoubleMap<java.lang.String> getMeasurableProducerMetrics()
- Specified by:
getMeasurableProducerMetrics
in interfacePubSubProducerAdapter
-
getBrokerAddress
public java.lang.String getBrokerAddress()
- Specified by:
getBrokerAddress
in interfacePubSubProducerAdapter
-
-