From 756b70f1037542ec59c182499f6d21ff8da670a0 Mon Sep 17 00:00:00 2001 From: Jon Lee Date: Mon, 10 Dec 2018 14:00:51 -0800 Subject: [PATCH] Add back LiKafkaProducer.partitionsFor() that takes a set of topics (#101) --- .../linkedin/kafka/clients/producer/LiKafkaProducer.java | 7 +++++++ .../kafka/clients/producer/LiKafkaProducerImpl.java | 1 + 2 files changed, 8 insertions(+) diff --git a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaProducer.java b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaProducer.java index db8342d..b681f6f 100644 --- a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaProducer.java +++ b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaProducer.java @@ -6,6 +6,10 @@ import com.linkedin.kafka.clients.annotations.InterfaceOrigin; import java.util.concurrent.TimeUnit; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.kafka.common.PartitionInfo; import org.apache.kafka.clients.producer.Producer; @@ -23,4 +27,7 @@ public interface LiKafkaProducer extends Producer { */ @InterfaceOrigin.LiKafkaClients void flush(long timeout, TimeUnit timeUnit); + + @InterfaceOrigin.LiKafkaClients + Map> partitionsFor(Set topics); } diff --git a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaProducerImpl.java b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaProducerImpl.java index db87a25..1e5a523 100644 --- a/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaProducerImpl.java +++ b/li-apache-kafka-clients/src/main/java/com/linkedin/kafka/clients/producer/LiKafkaProducerImpl.java @@ -351,6 +351,7 @@ public List partitionsFor(String topic) { return _producer.partitionsFor(topic); } + @Override public Map> partitionsFor(Set topics) { //TODO come back here when upstream API settles throw new UnsupportedOperationException("not implemented");