hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Haohui Mai (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7257) Add the time of last HA state transition to NN's /jmx page
Date Thu, 23 Oct 2014 20:15:34 GMT

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

Haohui Mai commented on HDFS-7257:
----------------------------------

Looks good to me. One nit:

{code}
+      final JMXGet jmx = new JMXGet();
+      final String serviceName = "NameNode";
+      jmx.setService(serviceName);
+      jmx.init();
+      final Long ltt1 = Long.parseLong(jmx.getValue("LastTransitionTime"));
+      assertTrue("lastTransitionTime should be > 0", ltt1 > 0);
{code}

The test code can use {{MBeanServer}} directly instead of going through JMXGet:

{code}
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
ObjectName mxbeanName = new ObjectName("Hadoop:service=NameNode,name=NameNodeInfo");
Long time = (Long) mbs.getAttribute(mxbeanName, "LastTransitionTime");
{code}

You can check out TestNameNodeMXBean for more details.

> Add the time of last HA state transition to NN's /jmx page
> ----------------------------------------------------------
>
>                 Key: HDFS-7257
>                 URL: https://issues.apache.org/jira/browse/HDFS-7257
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: namenode
>            Reporter: Charles Lamb
>            Assignee: Charles Lamb
>            Priority: Minor
>         Attachments: HDFS-7257.001.patch, HDFS-7257.002.patch, HDFS-7257.003.patch, HDFS-7257.004.patch
>
>
> It would be useful to some monitoring apps to expose the last HA transition time in the
NN's /jmx page.



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

Mime
View raw message