kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: MINOR: Remove dead code
Date Wed, 18 Oct 2017 21:15:28 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 5c1a85caa -> 6cb649b56


MINOR: Remove dead code

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>

Closes #4087 from ijuma/remove-dead-code


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/6cb649b5
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/6cb649b5
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/6cb649b5

Branch: refs/heads/trunk
Commit: 6cb649b56b1194f4f1cf080d4596244119c3ce78
Parents: 5c1a85c
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Wed Oct 18 22:15:22 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Wed Oct 18 22:15:22 2017 +0100

----------------------------------------------------------------------
 core/src/main/scala/kafka/metrics/KafkaMetricsGroup.scala | 10 ++--------
 core/src/main/scala/kafka/server/ClientQuotaManager.scala |  1 -
 .../main/scala/kafka/server/DynamicConfigManager.scala    |  2 +-
 .../kafka/api/AdminClientIntegrationTest.scala            |  2 +-
 .../coordinator/group/GroupMetadataManagerTest.scala      |  2 +-
 .../scala/unit/kafka/server/DelayedOperationTest.scala    |  1 -
 .../scala/unit/kafka/server/DynamicConfigChangeTest.scala |  1 -
 7 files changed, 5 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/6cb649b5/core/src/main/scala/kafka/metrics/KafkaMetricsGroup.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/metrics/KafkaMetricsGroup.scala b/core/src/main/scala/kafka/metrics/KafkaMetricsGroup.scala
index 46db8bc..a3a53e1 100644
--- a/core/src/main/scala/kafka/metrics/KafkaMetricsGroup.scala
+++ b/core/src/main/scala/kafka/metrics/KafkaMetricsGroup.scala
@@ -17,7 +17,6 @@
 
 package kafka.metrics
 
-
 import java.util.concurrent.TimeUnit
 
 import com.yammer.metrics.Metrics
@@ -28,7 +27,6 @@ import kafka.utils.Logging
 
 import scala.collection.immutable
 import scala.collection.JavaConverters._
-import javax.management.ObjectName
 
 
 trait KafkaMetricsGroup extends Logging {
@@ -50,11 +48,7 @@ trait KafkaMetricsGroup extends Logging {
 
 
   protected def explicitMetricName(group: String, typeName: String, name: String,
-      tags: scala.collection.Map[String, String]): MetricName = {
-
-    // Tags may contain ipv6 address with ':', which is not valid in JMX ObjectName
-    def quoteIfRequired(value: String) = if (value.contains(':')) ObjectName.quote(value)
else value
-    val metricTags = tags.map(kv => (kv._1, quoteIfRequired(kv._2)))
+                                   tags: scala.collection.Map[String, String]): MetricName
= {
 
     val nameBuilder: StringBuilder = new StringBuilder
 
@@ -73,7 +67,7 @@ trait KafkaMetricsGroup extends Logging {
     val tagsName = KafkaMetricsGroup.toMBeanName(tags)
     tagsName.foreach(nameBuilder.append(",").append(_))
 
-    new MetricName(group, typeName, name, scope, nameBuilder.toString())
+    new MetricName(group, typeName, name, scope, nameBuilder.toString)
   }
 
   def newGauge[T](name: String, metric: Gauge[T], tags: scala.collection.Map[String, String]
= Map.empty) =

http://git-wip-us.apache.org/repos/asf/kafka/blob/6cb649b5/core/src/main/scala/kafka/server/ClientQuotaManager.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/ClientQuotaManager.scala b/core/src/main/scala/kafka/server/ClientQuotaManager.scala
index 5d0b966..96739f6 100644
--- a/core/src/main/scala/kafka/server/ClientQuotaManager.scala
+++ b/core/src/main/scala/kafka/server/ClientQuotaManager.scala
@@ -318,7 +318,6 @@ class ClientQuotaManager(private val config: ClientQuotaManagerConfig,
     }
     val quotaUser = if (quotaId == clientQuotaId) "" else sanitizedUser
     val quotaClientId = if (quotaId == userQuotaId) "" else clientId
-    val quotaSanitizedClientId = if (quotaId == userQuotaId) "" else sanitizerClientId
     QuotaEntity(quotaId, quotaUser, quotaClientId, sanitizerClientId, quota)
   }
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/6cb649b5/core/src/main/scala/kafka/server/DynamicConfigManager.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/server/DynamicConfigManager.scala b/core/src/main/scala/kafka/server/DynamicConfigManager.scala
index 69f9e96..634b0c2 100644
--- a/core/src/main/scala/kafka/server/DynamicConfigManager.scala
+++ b/core/src/main/scala/kafka/server/DynamicConfigManager.scala
@@ -28,7 +28,7 @@ import kafka.admin.AdminUtils
 import kafka.utils.json.JsonObject
 import org.apache.kafka.common.config.types.Password
 import org.apache.kafka.common.security.scram.ScramMechanism
-import org.apache.kafka.common.utils.{Sanitizer, Time}
+import org.apache.kafka.common.utils.Time
 
 /**
  * Represents all the entities that can be configured via ZK

http://git-wip-us.apache.org/repos/asf/kafka/blob/6cb649b5/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala
index a173715..583ba7a 100644
--- a/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala
@@ -488,7 +488,7 @@ class AdminClientIntegrationTest extends KafkaServerTestHarness with Logging
{
     alterResult = client.createPartitions(Map(topic2 ->
       NewPartitions.increaseTo(3, newPartition2Assignments)).asJava, actuallyDoIt)
     altered = alterResult.values.get(topic2).get
-    var actualPartitions2 = partitions(topic2)
+    val actualPartitions2 = partitions(topic2)
     assertEquals(3, actualPartitions2.size)
     assertEquals(Seq(0, 1), actualPartitions2.get(1).replicas.asScala.map(_.id).toList)
     assertEquals(Seq(1, 2), actualPartitions2.get(2).replicas.asScala.map(_.id).toList)

http://git-wip-us.apache.org/repos/asf/kafka/blob/6cb649b5/core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataManagerTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataManagerTest.scala
b/core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataManagerTest.scala
index 8e5b593..ceee8b2 100644
--- a/core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataManagerTest.scala
+++ b/core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataManagerTest.scala
@@ -23,7 +23,7 @@ import kafka.common.OffsetAndMetadata
 import kafka.log.{Log, LogAppendInfo}
 import kafka.server.{FetchDataInfo, KafkaConfig, LogOffsetMetadata, ReplicaManager}
 import kafka.utils.TestUtils.fail
-import kafka.utils.{KafkaScheduler, Logging, MockTime, TestUtils, ZkUtils}
+import kafka.utils.{KafkaScheduler, MockTime, TestUtils, ZkUtils}
 import org.apache.kafka.common.TopicPartition
 import org.apache.kafka.common.protocol.Errors
 import org.apache.kafka.common.record._

http://git-wip-us.apache.org/repos/asf/kafka/blob/6cb649b5/core/src/test/scala/unit/kafka/server/DelayedOperationTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/server/DelayedOperationTest.scala b/core/src/test/scala/unit/kafka/server/DelayedOperationTest.scala
index fdfb582..5b1daff 100644
--- a/core/src/test/scala/unit/kafka/server/DelayedOperationTest.scala
+++ b/core/src/test/scala/unit/kafka/server/DelayedOperationTest.scala
@@ -18,7 +18,6 @@
 package kafka.server
 
 import java.util.concurrent.{Executors, Future}
-import java.util.concurrent.locks.ReentrantLock
 
 import kafka.utils.CoreUtils.inLock
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/6cb649b5/core/src/test/scala/unit/kafka/server/DynamicConfigChangeTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/server/DynamicConfigChangeTest.scala b/core/src/test/scala/unit/kafka/server/DynamicConfigChangeTest.scala
index 2e0b454..9d2bb8b 100644
--- a/core/src/test/scala/unit/kafka/server/DynamicConfigChangeTest.scala
+++ b/core/src/test/scala/unit/kafka/server/DynamicConfigChangeTest.scala
@@ -28,7 +28,6 @@ import kafka.integration.KafkaServerTestHarness
 import kafka.utils._
 import kafka.admin.{AdminOperationException, AdminUtils}
 import org.apache.kafka.common.TopicPartition
-import org.apache.kafka.common.utils.Sanitizer
 
 import scala.collection.Map
 


Mime
View raw message