HDFS-13298. Addendum: Ozone: Make ozone/hdsl/cblock modules turned off by 
default. Contributed by Elek, Marton.

While committing the original patch, some files were missed. This patch 
addresses that issue.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7ace05b3
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7ace05b3
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7ace05b3

Branch: refs/heads/HDFS-7240
Commit: 7ace05b3fe35f7774f66651db025bbbfb9498b8e
Parents: f76819c
Author: Anu Engineer <[email protected]>
Authored: Mon Mar 19 15:58:50 2018 -0700
Committer: Anu Engineer <[email protected]>
Committed: Mon Mar 19 15:58:50 2018 -0700

----------------------------------------------------------------------
 .../src/main/resources/webapps/datanode/dn.js   |  92 +++++
 .../webapps/static/angular-1.6.4.min.js         | 332 +++++++++++++++++
 .../webapps/static/angular-nvd3-1.0.9.min.js    |   1 +
 .../webapps/static/angular-route-1.6.4.min.js   |  17 +
 .../resources/webapps/static/d3-3.5.17.min.js   |   5 +
 .../main/resources/webapps/static/dfs-dust.js   | 133 +++++++
 .../resources/webapps/static/nvd3-1.8.5.min.css |   2 +
 .../webapps/static/nvd3-1.8.5.min.css.map       |   1 +
 .../resources/webapps/static/nvd3-1.8.5.min.js  |  11 +
 .../webapps/static/nvd3-1.8.5.min.js.map        |   1 +
 .../src/main/resources/webapps/static/ozone.css |  60 ++++
 .../src/main/resources/webapps/static/ozone.js  | 355 +++++++++++++++++++
 .../webapps/static/templates/config.html        |  91 +++++
 .../resources/webapps/static/templates/jvm.html |  26 ++
 .../webapps/static/templates/menu.html          |  60 ++++
 .../webapps/static/templates/overview.html      |  39 ++
 .../webapps/static/templates/rpc-metrics.html   |  87 +++++
 17 files changed, 1313 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/7ace05b3/hadoop-hdsl/framework/src/main/resources/webapps/datanode/dn.js
----------------------------------------------------------------------
diff --git a/hadoop-hdsl/framework/src/main/resources/webapps/datanode/dn.js 
b/hadoop-hdsl/framework/src/main/resources/webapps/datanode/dn.js
new file mode 100644
index 0000000..3b67167
--- /dev/null
+++ b/hadoop-hdsl/framework/src/main/resources/webapps/datanode/dn.js
@@ -0,0 +1,92 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+(function () {
+  "use strict";
+
+  var data = {ozone: {enabled: false}};
+
+  dust.loadSource(dust.compile($('#tmpl-dn').html(), 'dn'));
+
+  function loadDatanodeInfo() {
+    $.get('/jmx?qry=Hadoop:service=DataNode,name=DataNodeInfo', function(resp) 
{
+      data.dn = workaround(resp.beans[0]);
+      data.dn.HostName = resp.beans[0]['DatanodeHostname'];
+      render();
+    }).fail(show_err_msg);
+  }
+
+  function loadOzoneScmInfo() {
+        
$.get('/jmx?qry=Hadoop:service=OzoneDataNode,name=SCMConnectionManager', 
function (resp) {
+            if (resp.beans.length > 0) {
+                data.ozone.SCMServers = resp.beans[0].SCMServers;
+                data.ozone.enabled = true;
+                render();
+            }
+        }).fail(show_err_msg);
+  }
+
+  function loadOzoneStorageInfo() {
+        
$.get('/jmx?qry=Hadoop:service=OzoneDataNode,name=ContainerLocationManager', 
function (resp) {
+            if (resp.beans.length > 0) {
+                data.ozone.LocationReport = resp.beans[0].LocationReport;
+                data.ozone.enabled = true;
+                render();
+            }
+        }).fail(show_err_msg);
+    }
+
+  function workaround(dn) {
+    function node_map_to_array(nodes) {
+      var res = [];
+      for (var n in nodes) {
+        var p = nodes[n];
+        p.name = n;
+        res.push(p);
+      }
+      return res;
+    }
+
+    dn.VolumeInfo = node_map_to_array(JSON.parse(dn.VolumeInfo));
+    dn.BPServiceActorInfo = JSON.parse(dn.BPServiceActorInfo);
+
+    return dn;
+  }
+
+  function render() {
+    var base = dust.makeBase({
+      'helper_relative_time' : function (chunk, ctx, bodies, params) {
+        var value = dust.helpers.tap(params.value, chunk, ctx);
+        return chunk.write(moment().subtract(Number(value), 
'seconds').fromNow(true));
+      }
+    });
+    dust.render('dn', base.push(data), function(err, out) {
+      $('#tab-overview').html(out);
+      $('#tab-overview').addClass('active');
+    });
+  }
+
+  function show_err_msg() {
+    $('#alert-panel-body').html("Failed to load datanode information");
+    $('#alert-panel').show();
+  }
+
+    loadDatanodeInfo();
+    loadOzoneScmInfo();
+    loadOzoneStorageInfo();
+
+})();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to