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-7331) Add Datanode network counts to datanode jmx page
Date Tue, 04 Nov 2014 00:57:34 GMT

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

Haohui Mai commented on HDFS-7331:
----------------------------------

Got it. It's a nice feature. Some comments:

{code}
+  final Map<String, Map<String, Long>> datanodeNetworkCounts =
+      new HashMap<String, Map<String, Long>>();
+
{code}

The size of the map needs to be bounded. A cachemap can do the job.

{code}
+  @Override // DataNodeMXBean
+  public String getDatanodeNetworkCounts() {
+    return JSON.toString(datanodeNetworkCounts);
+  }
+
{code}

The net effect is that the JMX will return a JSON string, but not a JSON object. You'll need
to return a map in the function directly so that the JMX can return a real JSON.

It can take some time to implement -- to me it also makes sense to expose the information
in a servlet, given the hierarchical structure of the data.


> Add Datanode network counts to datanode jmx page
> ------------------------------------------------
>
>                 Key: HDFS-7331
>                 URL: https://issues.apache.org/jira/browse/HDFS-7331
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>            Reporter: Charles Lamb
>            Assignee: Charles Lamb
>            Priority: Minor
>         Attachments: HDFS-7331.001.patch
>
>
> Add per-datanode counts to the datanode jmx page. For example, networkErrors could be
exposed like this:
> {noformat}
>   }, {
> ...
>     "DatanodeNetworkCounts" : "{\"dn1\":{\"networkErrors\":1}}",
> ...
>     "NamenodeAddresses" : "{\"localhost\":\"BP-1103235125-127.0.0.1-1415057084497\"}",
>     "VolumeInfo" : "{\"/tmp/hadoop-cwl/dfs/data/current\":{\"freeSpace\":3092725760,\"usedSpace\":28672,\"reservedSpace\":0}}",
>     "ClusterId" : "CID-4b38f2ae-5e58-4e15-b3cf-3ba3f46e724e"
>   }, {
> {noformat}



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

Mime
View raw message