hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From syuanji...@apache.org
Subject [03/24] hbase git commit: HBASE-15293 Handle TableNotFound and IllegalArgument exceptions in table.jsp (Samir Ahmic)
Date Mon, 11 Apr 2016 16:10:28 GMT
HBASE-15293 Handle TableNotFound and IllegalArgument exceptions in table.jsp (Samir Ahmic)


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

Branch: refs/heads/hbase-12439
Commit: 5d79790c55b6caa0f9cbc77e14a5f39940b02236
Parents: 89d7501
Author: tedyu <yuzhihong@gmail.com>
Authored: Fri Apr 1 02:13:18 2016 -0700
Committer: tedyu <yuzhihong@gmail.com>
Committed: Fri Apr 1 02:13:18 2016 -0700

----------------------------------------------------------------------
 .../resources/hbase-webapps/master/table.jsp    | 28 ++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5d79790c/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 8a83565..4a151e7 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -43,7 +43,8 @@
   import="org.apache.hadoop.hbase.TableName"
   import="org.apache.hadoop.hbase.HColumnDescriptor"
   import="org.apache.hadoop.hbase.client.RegionReplicaUtil"
-  import="org.apache.hadoop.hbase.HBaseConfiguration" %>
+  import="org.apache.hadoop.hbase.HBaseConfiguration"
+  import="org.apache.hadoop.hbase.TableNotFoundException"%>
 <%
   HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
   Configuration conf = master.getConfiguration();
@@ -126,6 +127,7 @@
 </div>
 <%
 if ( fqtn != null ) {
+  try {
   table = (HTable) master.getConnection().getTable(TableName.valueOf(fqtn));
   if (table.getTableDescriptor().getRegionReplication() > 1) {
     tableHeader = "<h2>Table Regions</h2><table class=\"table table-striped\"
style=\"table-layout: fixed; word-wrap: break-word;\"><tr><th style=\"width:22%\">Name</th><th>Region
Server</th><th style=\"width:22%\">Start Key</th><th style=\"width:22%\">End
Key</th><th>Locality</th><th>Requests</th><th>ReplicaID</th></tr>";
@@ -424,7 +426,29 @@ Actions:
 </div>
 </div>
 <% }
-} else { // handle the case for fqtn is null with error message + redirect
+  } catch(TableNotFoundException e) { %>
+  <div class="container-fluid content">
+    <div class="row inner_header">
+      <div class="page-header">
+        <h1>Table not found</h1>
+       </div>
+    </div>
+    <p><hr><p>
+    <p>Go <a href="javascript:history.back()">Back</a>
+  </div> <%
+  } catch(IllegalArgumentException e) { %>
+  <div class="container-fluid content">
+    <div class="row inner_header">
+      <div class="page-header">
+        <h1>Table qualifier must not be empty</h1>
+      </div>
+    </div>
+    <p><hr><p>
+    <p>Go <a href="javascript:history.back()">Back</a>
+  </div> <%
+  }
+}
+  else { // handle the case for fqtn is null with error message + redirect
 %>
 <div class="container-fluid content">
     <div class="row inner_header">


Mime
View raw message