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: Remove zkclient dependency (#7036)
Date Fri, 05 Jul 2019 14:50:58 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 57903be  MINOR: Remove zkclient dependency (#7036)
57903be is described below

commit 57903be49665566260160a6f1f995409ec48c9bc
Author: Ismael Juma <ismael@juma.me.uk>
AuthorDate: Fri Jul 5 07:50:32 2019 -0700

    MINOR: Remove zkclient dependency (#7036)
    
    ZkUtils was removed so we don't need this anymore.
    
    Also:
    * Fix ZkSecurityMigrator and ReplicaManagerTest not to
    reference ZkClient classes.
    * Remove references to zkclient in various `log4j.properties`
    and `import-control.xml`.
    
    Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Stanislav Kozlovski <stanislav_kozlovski@outlook.com>
---
 build.gradle                                                   | 3 ---
 checkstyle/import-control.xml                                  | 1 -
 config/connect-log4j.properties                                | 1 -
 config/log4j.properties                                        | 3 +--
 core/src/main/scala/kafka/admin/ZkSecurityMigrator.scala       | 9 ++++-----
 core/src/test/resources/log4j.properties                       | 1 -
 core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala | 6 ------
 gradle/dependencies.gradle                                     | 2 --
 tests/kafkatest/services/kafka/templates/log4j.properties      | 1 -
 tests/kafkatest/services/templates/connect_log4j.properties    | 1 -
 10 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/build.gradle b/build.gradle
index a56bd67..8a3cfa7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -674,9 +674,6 @@ project(':core') {
     compile libs.scalaReflect
     compile libs.scalaLogging
     compile libs.slf4jApi
-    compile(libs.zkclient) {
-      exclude module: 'zookeeper'
-    }
     compile(libs.zookeeper) {
       exclude module: 'slf4j-log4j12'
       exclude module: 'log4j'
diff --git a/checkstyle/import-control.xml b/checkstyle/import-control.xml
index a76fd1d..076b8ed 100644
--- a/checkstyle/import-control.xml
+++ b/checkstyle/import-control.xml
@@ -264,7 +264,6 @@
 
     <subpackage name="processor">
       <subpackage name="internals">
-        <allow pkg="org.I0Itec.zkclient" />
         <allow pkg="com.fasterxml.jackson" />
         <allow pkg="org.apache.zookeeper" />
         <allow pkg="org.apache.zookeeper" />
diff --git a/config/connect-log4j.properties b/config/connect-log4j.properties
index 4e1e196..d4b7adb 100644
--- a/config/connect-log4j.properties
+++ b/config/connect-log4j.properties
@@ -28,5 +28,4 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c:%L)%n
 
 log4j.logger.org.apache.zookeeper=ERROR
-log4j.logger.org.I0Itec.zkclient=ERROR
 log4j.logger.org.reflections=ERROR
diff --git a/config/log4j.properties b/config/log4j.properties
index 3ff3f9e..5de1c19 100644
--- a/config/log4j.properties
+++ b/config/log4j.properties
@@ -57,8 +57,7 @@ log4j.appender.authorizerAppender.File=${kafka.logs.dir}/kafka-authorizer.log
 log4j.appender.authorizerAppender.layout=org.apache.log4j.PatternLayout
 log4j.appender.authorizerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n
 
-# Change the two lines below to adjust ZK client logging
-log4j.logger.org.I0Itec.zkclient.ZkClient=INFO
+# Change the line below to adjust ZK client logging
 log4j.logger.org.apache.zookeeper=INFO
 
 # Change the two lines below to adjust the general broker logging level (output to server.log
and stdout)
diff --git a/core/src/main/scala/kafka/admin/ZkSecurityMigrator.scala b/core/src/main/scala/kafka/admin/ZkSecurityMigrator.scala
index 5cab801..65ce014 100644
--- a/core/src/main/scala/kafka/admin/ZkSecurityMigrator.scala
+++ b/core/src/main/scala/kafka/admin/ZkSecurityMigrator.scala
@@ -19,7 +19,6 @@ package kafka.admin
 
 import kafka.utils.{CommandDefaultOptions, CommandLineUtils, Logging}
 import kafka.zk.{KafkaZkClient, ZkData, ZkSecurityMigratorUtils}
-import org.I0Itec.zkclient.exception.ZkException
 import org.apache.kafka.common.security.JaasUtils
 import org.apache.kafka.common.utils.Time
 import org.apache.zookeeper.AsyncCallback.{ChildrenCallback, StatCallback}
@@ -182,10 +181,10 @@ class ZkSecurityMigrator(zkClient: KafkaZkClient) extends Logging {
           // Starting a new session isn't really a problem, but it'd complicate
           // the logic of the tool, so we quit and let the user re-run it.
           System.out.println("ZooKeeper session expired while changing ACLs")
-          promise failure ZkException.create(KeeperException.create(Code.get(rc)))
+          promise failure KeeperException.create(Code.get(rc))
         case _ =>
           System.out.println("Unexpected return code: %d".format(rc))
-          promise failure ZkException.create(KeeperException.create(Code.get(rc)))
+          promise failure KeeperException.create(Code.get(rc))
       }
     }
   }
@@ -211,10 +210,10 @@ class ZkSecurityMigrator(zkClient: KafkaZkClient) extends Logging {
           // Starting a new session isn't really a problem, but it'd complicate
           // the logic of the tool, so we quit and let the user re-run it.
           System.out.println("ZooKeeper session expired while changing ACLs")
-          promise failure ZkException.create(KeeperException.create(Code.get(rc)))
+          promise failure KeeperException.create(Code.get(rc))
         case _ =>
           System.out.println("Unexpected return code: %d".format(rc))
-          promise failure ZkException.create(KeeperException.create(Code.get(rc)))
+          promise failure KeeperException.create(Code.get(rc))
       }
     }
   }
diff --git a/core/src/test/resources/log4j.properties b/core/src/test/resources/log4j.properties
index d394a2a..0648d7f 100644
--- a/core/src/test/resources/log4j.properties
+++ b/core/src/test/resources/log4j.properties
@@ -22,5 +22,4 @@ log4j.logger.kafka=ERROR
 log4j.logger.org.apache.kafka=ERROR
 
 # zkclient can be verbose, during debugging it is common to adjust it separately
-log4j.logger.org.I0Itec.zkclient.ZkClient=WARN
 log4j.logger.org.apache.zookeeper=WARN
diff --git a/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala b/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
index 6091503..c82ee42 100644
--- a/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
+++ b/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
@@ -36,7 +36,6 @@ import kafka.utils.TestUtils.createBroker
 import kafka.utils.timer.MockTimer
 import kafka.utils.{MockScheduler, MockTime, TestUtils}
 import kafka.zk.KafkaZkClient
-import org.I0Itec.zkclient.ZkClient
 import org.apache.kafka.common.metrics.Metrics
 import org.apache.kafka.common.protocol.{ApiKeys, Errors}
 import org.apache.kafka.common.record._
@@ -50,7 +49,6 @@ import org.apache.kafka.common.requests.{EpochEndOffset, IsolationLevel,
LeaderA
 import org.apache.kafka.common.security.auth.KafkaPrincipal
 import org.apache.kafka.common.utils.Time
 import org.apache.kafka.common.{Node, TopicPartition}
-import org.apache.zookeeper.data.Stat
 import org.easymock.EasyMock
 import org.junit.Assert._
 import org.junit.{After, Before, Test}
@@ -63,7 +61,6 @@ class ReplicaManagerTest {
   val topic = "test-topic"
   val time = new MockTime
   val metrics = new Metrics
-  var zkClient: ZkClient = _
   var kafkaZkClient: KafkaZkClient = _
 
   // Constants defined for readability
@@ -74,12 +71,9 @@ class ReplicaManagerTest {
 
   @Before
   def setUp() {
-    zkClient = EasyMock.createMock(classOf[ZkClient])
     kafkaZkClient = EasyMock.createMock(classOf[KafkaZkClient])
     EasyMock.expect(kafkaZkClient.getEntityConfigs(EasyMock.anyString(), EasyMock.anyString())).andReturn(new
Properties()).anyTimes()
     EasyMock.replay(kafkaZkClient)
-    EasyMock.expect(zkClient.readData(EasyMock.anyString(), EasyMock.anyObject[Stat])).andReturn(null).anyTimes()
-    EasyMock.replay(zkClient)
   }
 
   @After
diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle
index f3924e0..191d1a9 100644
--- a/gradle/dependencies.gradle
+++ b/gradle/dependencies.gradle
@@ -112,7 +112,6 @@ versions += [
   spotbugs: "3.1.12",
   spotbugsPlugin: "1.6.9",
   spotlessPlugin: "3.23.0",
-  zkclient: "0.11",
   zookeeper: "3.4.14",
   zstd: "1.4.0-1"
 ]
@@ -178,7 +177,6 @@ libs += [
   slf4jApi: "org.slf4j:slf4j-api:$versions.slf4j",
   slf4jlog4j: "org.slf4j:slf4j-log4j12:$versions.slf4j",
   snappy: "org.xerial.snappy:snappy-java:$versions.snappy",
-  zkclient: "com.101tec:zkclient:$versions.zkclient",
   zookeeper: "org.apache.zookeeper:zookeeper:$versions.zookeeper",
   jfreechart: "jfreechart:jfreechart:$versions.jfreechart",
   mavenArtifact: "org.apache.maven:maven-artifact:$versions.mavenArtifact",
diff --git a/tests/kafkatest/services/kafka/templates/log4j.properties b/tests/kafkatest/services/kafka/templates/log4j.properties
index cac1250..5963c39 100644
--- a/tests/kafkatest/services/kafka/templates/log4j.properties
+++ b/tests/kafkatest/services/kafka/templates/log4j.properties
@@ -110,7 +110,6 @@ log4j.logger.kafka.producer.async.DefaultEventHandler={{ log_level|default("DEBU
 log4j.logger.kafka.client.ClientUtils={{ log_level|default("DEBUG") }}, kafkaInfoAppender,
kafkaDebugAppender
 log4j.logger.kafka.perf={{ log_level|default("DEBUG") }}, kafkaInfoAppender, kafkaDebugAppender
 log4j.logger.kafka.perf.ProducerPerformance$ProducerThread={{ log_level|default("DEBUG")
}}, kafkaInfoAppender, kafkaDebugAppender
-log4j.logger.org.I0Itec.zkclient.ZkClient={{ log_level|default("DEBUG") }}, kafkaInfoAppender,
kafkaDebugAppender
 log4j.logger.kafka={{ log_level|default("DEBUG") }}, kafkaInfoAppender, kafkaDebugAppender
 
 log4j.logger.kafka.network.RequestChannel$={{ log_level|default("DEBUG") }}, requestInfoAppender,
requestDebugAppender
diff --git a/tests/kafkatest/services/templates/connect_log4j.properties b/tests/kafkatest/services/templates/connect_log4j.properties
index adb35b3..4894612 100644
--- a/tests/kafkatest/services/templates/connect_log4j.properties
+++ b/tests/kafkatest/services/templates/connect_log4j.properties
@@ -26,5 +26,4 @@ log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
 log4j.appender.FILE.layout.conversionPattern=[%d] %p %m (%c)%n
 
 log4j.logger.org.apache.zookeeper=ERROR
-log4j.logger.org.I0Itec.zkclient=ERROR
 log4j.logger.org.reflections=ERROR


Mime
View raw message