[ 
https://issues.apache.org/jira/browse/KAFKA-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14329345#comment-14329345
 ] 

Jonathan Rafalski commented on KAFKA-1679:
------------------------------------------

Taking a look into this, does anyone know the purpose of this check (line 106 
and 116) in the JmxTool?

{code:borderStyle=solid}
if(keys.size == numExpectedAttributes.map(_._2).foldLeft(0)(_ + _) + 1)...
{code}

Stepping through the code it seems to me since we don't have an "else" 
situation where if they don't equal we warn or only print only some of the 
attributes so there are two possible solutions:

1) if there is no good reason for the check then we just remove it and print 
everything that is returned by the attributes query

2) if the check is valid for a reason we using the attributesWhitelistExists 
flag to bypass this check and just print all to the csv and then add an else 
cause that warns the user that the number of attributes does not match the 
expected result.

Let me know which approach makes the most sense.

> JmxTool outputs nothing if any mbean attributes can't be retrieved
> ------------------------------------------------------------------
>
>                 Key: KAFKA-1679
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1679
>             Project: Kafka
>          Issue Type: Bug
>          Components: tools
>            Reporter: Ryan Berdeen
>            Priority: Minor
>              Labels: newbie
>
> JmxTool counts the number of attributes for all MBeans and if the number of 
> attributes retrieved does not equal this number, nothing is printed.
> Several {{java.lang:type=MemoryPool}} MBeans have unsupported attributes (see 
> HADOOP-8027, for example), so running JmxTool with no arguments fails to 
> fetch these metrics and outputs nothing while continuing to run.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to