hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1568581 - in /hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/webapps/hdfs/dfshealth.html src/main/webapps/hdfs/dfshealth.js
Date Sat, 15 Feb 2014 01:27:13 GMT
Author: arp
Date: Sat Feb 15 01:27:12 2014
New Revision: 1568581

URL: http://svn.apache.org/r1568581
Log:
HDFS-5759. Merging r1568578 from trunk to branch-2

Modified:
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1568581&r1=1568580&r2=1568581&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Sat Feb 15
01:27:12 2014
@@ -160,6 +160,9 @@ Release 2.4.0 - UNRELEASED
 
     HDFS-5953. TestBlockReaderFactory fails in trunk. (Akira Ajisaka via wang)
 
+    HDFS-5759. Web UI does not show up during the period of loading FSImage.
+    (Haohui Mai via Arpit Agarwal)
+
   BREAKDOWN OF HDFS-5698 SUBTASKS AND RELATED JIRAS
 
     HDFS-5717. Save FSImage header in protobuf. (Haohui Mai via jing9)

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html?rev=1568581&r1=1568580&r2=1568581&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
(original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.html
Sat Feb 15 01:27:12 2014
@@ -151,7 +151,7 @@
 {/fs}
 </table>
 
-<div class="page-header"><h1>Namenode Journal Status</h1></div>
+<div class="page-header"><h1>NameNode Journal Status</h1></div>
 <p><b>Current transaction ID:</b> {nn.JournalTransactionInfo.LastAppliedOrWrittenTxId}</p>
 <table class="table" title="NameNode Journals">
   <thead>

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js?rev=1568581&r1=1568580&r2=1568581&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
(original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/hdfs/dfshealth.js
Sat Feb 15 01:27:12 2014
@@ -50,24 +50,23 @@
     var data = {};
 
     // Workarounds for the fact that JMXJsonServlet returns non-standard JSON strings
-    function data_workaround(d) {
-      d.nn.JournalTransactionInfo = JSON.parse(d.nn.JournalTransactionInfo);
-      d.nn.NameJournalStatus = JSON.parse(d.nn.NameJournalStatus);
-      d.nn.NameDirStatuses = JSON.parse(d.nn.NameDirStatuses);
-      d.nn.NodeUsage = JSON.parse(d.nn.NodeUsage);
-      d.nn.CorruptFiles = JSON.parse(d.nn.CorruptFiles);
-      return d;
+    function workaround(nn) {
+      nn.JournalTransactionInfo = JSON.parse(nn.JournalTransactionInfo);
+      nn.NameJournalStatus = JSON.parse(nn.NameJournalStatus);
+      nn.NameDirStatuses = JSON.parse(nn.NameDirStatuses);
+      nn.NodeUsage = JSON.parse(nn.NodeUsage);
+      nn.CorruptFiles = JSON.parse(nn.CorruptFiles);
+      return nn;
     }
 
     load_json(
       BEANS,
-      function(d) {
+      guard_with_startup_progress(function(d) {
         for (var k in d) {
-          data[k] = d[k].beans[0];
+          data[k] = k === 'nn' ? workaround(d[k].beans[0]) : d[k].beans[0];
         }
-        data = data_workaround(data);
         render();
-      },
+      }),
       function (url, jqxhr, text, err) {
         show_err_msg('<p>Failed to retrieve data from ' + url + ', cause: ' + err +
'</p>');
       });
@@ -92,6 +91,19 @@
     show_err_msg('<p>Failed to retrieve data from ' + url + ', cause: ' + err + '</p>');
   }
 
+  function guard_with_startup_progress(fn) {
+    return function() {
+      try {
+        fn.apply(this, arguments);
+      } catch (err) {
+        if (err instanceof TypeError) {
+          show_err_msg('NameNode is still loading. Redirecting to the Startup Progress page.');
+          load_startup_progress();
+        }
+      }
+    };
+  }
+
   function load_startup_progress() {
     function workaround(r) {
       function rename_property(o, s, d) {
@@ -143,25 +155,29 @@
       return r;
     }
 
-    $.get('/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo', function (resp) {
-      var data = workaround(resp.beans[0]);
-      dust.render('datanode-info', data, function(err, out) {
-        $('#tab-datanode').html(out);
-        $('#ui-tabs a[href="#tab-datanode"]').tab('show');
-      });
-    }).error(ajax_error_handler);
+    $.get(
+      '/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo',
+      guard_with_startup_progress(function (resp) {
+        var data = workaround(resp.beans[0]);
+        dust.render('datanode-info', data, function(err, out) {
+          $('#tab-datanode').html(out);
+          $('#ui-tabs a[href="#tab-datanode"]').tab('show');
+        });
+      })).error(ajax_error_handler);
   }
 
   $('a[href="#tab-datanode"]').click(load_datanode_info);
 
   function load_snapshot_info() {
-    $.get('/jmx?qry=Hadoop:service=NameNode,name=FSNamesystemState', function (resp) {
-      var data = JSON.parse(resp.beans[0].SnapshotStats);
-      dust.render('snapshot-info', data, function(err, out) {
-        $('#tab-snapshot').html(out);
-        $('#ui-tabs a[href="#tab-snapshot"]').tab('show');
-      });
-    }).error(ajax_error_handler);
+    $.get(
+      '/jmx?qry=Hadoop:service=NameNode,name=FSNamesystemState',
+      guard_with_startup_progress(function (resp) {
+        var data = JSON.parse(resp.beans[0].SnapshotStats);
+        dust.render('snapshot-info', data, function(err, out) {
+          $('#tab-snapshot').html(out);
+          $('#ui-tabs a[href="#tab-snapshot"]').tab('show');
+        });
+      })).error(ajax_error_handler);
   }
 
   $('#ui-tabs a[href="#tab-snapshot"]').click(load_snapshot_info);



Mime
View raw message