hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-13001 NullPointer in master logs for table.jsp (Vikas Vishwakarma)
Date Tue, 24 Feb 2015 04:50:31 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 b5590ac72 -> bb3ca8ed1


HBASE-13001 NullPointer in master logs for table.jsp (Vikas Vishwakarma)


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

Branch: refs/heads/branch-1
Commit: bb3ca8ed1267fef1e115553fc5663fcffab155ef
Parents: b5590ac
Author: stack <stack@apache.org>
Authored: Mon Feb 23 20:50:22 2015 -0800
Committer: stack <stack@apache.org>
Committed: Mon Feb 23 20:50:22 2015 -0800

----------------------------------------------------------------------
 .../resources/hbase-webapps/master/table.jsp    | 41 ++++++++++++--------
 1 file changed, 25 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bb3ca8ed/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
index 8f9fc73..945689b 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -44,15 +44,9 @@
   Configuration conf = master.getConfiguration();
   MetaTableLocator metaTableLocator = new MetaTableLocator();
   String fqtn = request.getParameter("name");
-  HTable table = new HTable(conf, fqtn);
+  HTable table = null;
   String tableHeader;
   boolean withReplica = false;
-  if (table.getTableDescriptor().getRegionReplication() > 1) {
-    tableHeader = "<h2>Table Regions</h2><table class=\"table table-striped\"><tr><th>Name</th><th>Region
Server</th><th>Start Key</th><th>End Key</th><th>Locality</th><th>Requests</th><th>ReplicaID</th></tr>";
-    withReplica = true;
-  } else {
-    tableHeader = "<h2>Table Regions</h2><table class=\"table table-striped\"><tr><th>Name</th><th>Region
Server</th><th>Start Key</th><th>End Key</th><th>Locality</th><th>Requests</th></tr>";
-  }
   ServerName rl = metaTableLocator.getMetaRegionLocation(master.getZooKeeper());
   boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false);
   boolean readOnly = conf.getBoolean("hbase.master.ui.readonly", false);
@@ -85,7 +79,7 @@
       <link href="/static/css/bootstrap.min.css" rel="stylesheet">
       <link href="/static/css/bootstrap-theme.min.css" rel="stylesheet">
       <link href="/static/css/hbase.css" rel="stylesheet">
-      <% if ( !readOnly && action != null ) { %>
+      <% if ( ( !readOnly && action != null ) || fqtn == null ) { %>
 	  <script type="text/javascript">
       <!--
 		  setTimeout("history.back()",5000);
@@ -124,7 +118,15 @@
     </div>
 </div>
 <% 
-if ( !readOnly && action != null ) { 
+if ( fqtn != null ) {
+  table = new HTable(conf, fqtn);
+  if (table.getTableDescriptor().getRegionReplication() > 1) {
+    tableHeader = "<h2>Table Regions</h2><table class=\"table table-striped\"><tr><th>Name</th><th>Region
Server</th><th>Start Key</th><th>End Key</th><th>Locality</th><th>Requests</th><th>ReplicaID</th></tr>";
+    withReplica = true;
+  } else {
+    tableHeader = "<h2>Table Regions</h2><table class=\"table table-striped\"><tr><th>Name</th><th>Region
Server</th><th>Start Key</th><th>End Key</th><th>Locality</th><th>Requests</th></tr>";
+  }
+  if ( !readOnly && action != null ) { 
 %>
 <div class="container">
 
@@ -157,11 +159,8 @@ if ( !readOnly && action != null ) {
 %>
 <p>Go <a href="javascript:history.back()">Back</a>, or wait for the redirect.
 </div>
-<script src="/static/js/jquery.min.js" type="text/javascript"></script>
-<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
-</body>
 <%
-} else {
+  } else {
 %>
 <div class="container">
 
@@ -356,12 +355,22 @@ Actions:
 </table>
 </center>
 </p>
+<% } %>
 </div>
 </div>
-<% } %>
-<%
-}
+<% }
+} else { // handle the case for fqtn is null with error message + redirect
 %>
+<div class="container">
+    <div class="row inner_header">
+        <div class="page-header">
+            <h1>Table not ready</h1>
+        </div>
+    </div>
+<p><hr><p>
+<p>Go <a href="javascript:history.back()">Back</a>, or wait for the redirect.
+</div>
+<% } %>
 <script src="/static/js/jquery.min.js" type="text/javascript"></script>
 <script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
 


Mime
View raw message