[ https://issues.apache.org/jira/browse/HDFS-4860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13673378#comment-13673378 ]
Todd Lipcon commented on HDFS-4860: ----------------------------------- It looks like your substring math is off -- manager":"FileJournalManage" Plus I think it's awfully hacky to assume that the toString() of a manager happens to have this particular format... why not add something like JournalManager.generateAttributeMap() so that each JM implementation can include its appropriate statistics in JMX without this string parsing hackery? Also, this code is unnecessarily verbose: {code} + + if (jas.isDisabled()) { + jasMap.put("Disabled", Boolean.TRUE.toString()); + } else { + jasMap.put("Disabled", Boolean.FALSE.toString()); + } {code} You could just do: {code} jasMap.put("Disabled", String.valueOf(jas.isDisabled())) {code} > Add additional attributes to JMX beans > -------------------------------------- > > Key: HDFS-4860 > URL: https://issues.apache.org/jira/browse/HDFS-4860 > Project: Hadoop HDFS > Issue Type: Improvement > Components: namenode > Affects Versions: 0.20.204.1, 3.0.0, 2.1.0-beta, 2.0.4-alpha > Reporter: Trevor Lorimer > Attachments: 0002-HDFS-4860.patch > > > Currently the JMX bean returns much of the data contained on the HDFS Health > webpage (dfsHealth.html). However there are several other attributes that are > required to be added. > I intend to add the following items to the appropriate bean in parenthesis : > Started time (NameNodeInfo), > Compiled info (NameNodeInfo), > Jvm MaxHeap, MaxNonHeap (JvmMetrics) > Node Usage stats (i.e. Min, Median, Max, stdev) (NameNodeInfo), > Count of decommissioned Live and Dead nodes (FSNamesystemState), > Journal Status (NodeNameInfo) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira