kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject [kafka] branch trunk updated: MINOR: Fix binary compatibility break in KafkaClientSupplier.getAdminClient (#7157)
Date Sat, 03 Aug 2019 04:38:12 GMT
This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 96c575a  MINOR: Fix binary compatibility break in KafkaClientSupplier.getAdminClient
(#7157)
96c575a is described below

commit 96c575a2c7d5740efe9b4fdbc5a6c22c558a3f8f
Author: Ismael Juma <ismael@juma.me.uk>
AuthorDate: Fri Aug 2 21:37:42 2019 -0700

    MINOR: Fix binary compatibility break in KafkaClientSupplier.getAdminClient (#7157)
    
    Changing the return type in an interface is a binary incompatible change.
    
    Reviewers: Jason Gustafson <jason@confluent.io>
---
 .../main/java/org/apache/kafka/streams/KafkaClientSupplier.java   | 8 ++++----
 .../streams/processor/internals/DefaultKafkaClientSupplier.java   | 6 +++---
 .../src/test/java/org/apache/kafka/test/MockClientSupplier.java   | 4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/streams/src/main/java/org/apache/kafka/streams/KafkaClientSupplier.java b/streams/src/main/java/org/apache/kafka/streams/KafkaClientSupplier.java
index cc9d27e..4ed2770 100644
--- a/streams/src/main/java/org/apache/kafka/streams/KafkaClientSupplier.java
+++ b/streams/src/main/java/org/apache/kafka/streams/KafkaClientSupplier.java
@@ -16,7 +16,7 @@
  */
 package org.apache.kafka.streams;
 
-import org.apache.kafka.clients.admin.Admin;
+import org.apache.kafka.clients.admin.AdminClient;
 import org.apache.kafka.clients.consumer.Consumer;
 import org.apache.kafka.clients.producer.Producer;
 import org.apache.kafka.streams.kstream.GlobalKTable;
@@ -31,12 +31,12 @@ import java.util.Map;
  */
 public interface KafkaClientSupplier {
     /**
-     * Create an {@link Admin} which is used for internal topic management.
+     * Create an {@link AdminClient} which is used for internal topic management.
      *
      * @param config Supplied by the {@link java.util.Properties} given to the {@link KafkaStreams}
-     * @return an instance of {@link Admin}
+     * @return an instance of {@link AdminClient}
      */
-    Admin getAdminClient(final Map<String, Object> config);
+    AdminClient getAdminClient(final Map<String, Object> config);
 
     /**
      * Create a {@link Producer} which is used to write records to sink topics.
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/DefaultKafkaClientSupplier.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/DefaultKafkaClientSupplier.java
index f56f834..69331b4 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/DefaultKafkaClientSupplier.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/DefaultKafkaClientSupplier.java
@@ -18,7 +18,7 @@ package org.apache.kafka.streams.processor.internals;
 
 import java.util.Map;
 
-import org.apache.kafka.clients.admin.Admin;
+import org.apache.kafka.clients.admin.AdminClient;
 import org.apache.kafka.clients.consumer.Consumer;
 import org.apache.kafka.clients.consumer.KafkaConsumer;
 import org.apache.kafka.clients.producer.KafkaProducer;
@@ -29,9 +29,9 @@ import org.apache.kafka.streams.KafkaClientSupplier;
 
 public class DefaultKafkaClientSupplier implements KafkaClientSupplier {
     @Override
-    public Admin getAdminClient(final Map<String, Object> config) {
+    public AdminClient getAdminClient(final Map<String, Object> config) {
         // create a new client upon each call; but expect this call to be only triggered
once so this should be fine
-        return Admin.create(config);
+        return AdminClient.create(config);
     }
 
     @Override
diff --git a/streams/src/test/java/org/apache/kafka/test/MockClientSupplier.java b/streams/src/test/java/org/apache/kafka/test/MockClientSupplier.java
index 4330d6c..d3430f2 100644
--- a/streams/src/test/java/org/apache/kafka/test/MockClientSupplier.java
+++ b/streams/src/test/java/org/apache/kafka/test/MockClientSupplier.java
@@ -16,7 +16,7 @@
  */
 package org.apache.kafka.test;
 
-import org.apache.kafka.clients.admin.Admin;
+import org.apache.kafka.clients.admin.AdminClient;
 import org.apache.kafka.clients.admin.MockAdminClient;
 import org.apache.kafka.clients.consumer.Consumer;
 import org.apache.kafka.clients.consumer.MockConsumer;
@@ -57,7 +57,7 @@ public class MockClientSupplier implements KafkaClientSupplier {
     }
 
     @Override
-    public Admin getAdminClient(final Map<String, Object> config) {
+    public AdminClient getAdminClient(final Map<String, Object> config) {
         return new MockAdminClient(cluster.nodes(), cluster.nodeById(0));
     }
 


Mime
View raw message