kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-2278: JmxTool should support querying all objects when object name is omitted
Date Fri, 11 Sep 2015 22:54:41 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 845514d62 -> 6c1957d00


KAFKA-2278: JmxTool should support querying all objects when object name is omitted

…ame is omitted

Author: Dong Lin <lindong28@gmail.com>

Reviewers: Aditya Auradkar, Manikumar Reddy, Guozhang Wang

Closes #181 from lindong28/KAFKA-2278


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

Branch: refs/heads/trunk
Commit: 6c1957d004f9b1a7d115543327cade274edc9cfd
Parents: 845514d
Author: Dong Lin <lindong28@gmail.com>
Authored: Fri Sep 11 15:57:36 2015 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Fri Sep 11 15:57:36 2015 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/JmxTool.scala | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/6c1957d0/core/src/main/scala/kafka/tools/JmxTool.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/JmxTool.scala b/core/src/main/scala/kafka/tools/JmxTool.scala
index c2b2030..d335b3e 100644
--- a/core/src/main/scala/kafka/tools/JmxTool.scala
+++ b/core/src/main/scala/kafka/tools/JmxTool.scala
@@ -97,8 +97,9 @@ object JmxTool extends Logging {
     val numExpectedAttributes: Map[ObjectName, Int] =
       attributesWhitelistExists match {
         case true => queries.map((_, attributesWhitelist.get.size)).toMap
-        case false => names.map((name: ObjectName) =>
-          (name, mbsc.getMBeanInfo(name).getAttributes().map(_.getName).size)).toMap
+        case false => names.map{(name: ObjectName) =>
+          val mbean = mbsc.getMBeanInfo(name)
+          (name, mbsc.getAttributes(name, mbean.getAttributes.map(_.getName)).size)}.toMap
       }
 
     // print csv header


Mime
View raw message