kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject git commit: kafka-1618 (followup); Exception thrown when running console producer with no port number for the broker; patched by Balaji Seshadri; reviewed by Jun Rao
Date Mon, 29 Sep 2014 21:40:15 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk a9c7d7724 -> 6861d4688


kafka-1618 (followup); Exception thrown when running console producer with no port number
for the broker; patched by Balaji Seshadri; reviewed by Jun Rao


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

Branch: refs/heads/trunk
Commit: 6861d4688ad044447881bfff22a1183ed8b6fc9e
Parents: a9c7d77
Author: BalajiSeshadri <balaji.seshadri@dish.com>
Authored: Mon Sep 29 14:40:09 2014 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Mon Sep 29 14:40:09 2014 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/utils/ToolsUtils.scala | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/6861d468/core/src/main/scala/kafka/utils/ToolsUtils.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/utils/ToolsUtils.scala b/core/src/main/scala/kafka/utils/ToolsUtils.scala
index cfbf279..fef9392 100644
--- a/core/src/main/scala/kafka/utils/ToolsUtils.scala
+++ b/core/src/main/scala/kafka/utils/ToolsUtils.scala
@@ -17,19 +17,17 @@
 package kafka.utils
 
 import joptsimple.OptionParser
-import scala.util.matching.Regex
 
 object ToolsUtils {
 
   def validatePortOrDie(parser: OptionParser, hostPort: String) = {
-    val regex = new Regex(":[0-9]")
     val hostPorts: Array[String] = if(hostPort.contains(','))
       hostPort.split(",")
     else
       Array(hostPort)
     val validHostPort = hostPorts.filter {
       hostPortData =>
-        regex.findAllMatchIn(hostPortData).size > 0
+        org.apache.kafka.common.utils.Utils.getPort(hostPortData) != null
     }
     val isValid = !(validHostPort.isEmpty) && validHostPort.size == hostPorts.length
     if(!isValid)


Mime
View raw message