hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [2/2] hbase git commit: HBASE-13718 added columns schema to table description in web view
Date Wed, 22 Feb 2017 05:27:43 GMT
HBASE-13718 added columns schema to table description in web view

Summary:
 * added a new table "Table Schema" on the table description page
 * per column, list all the key/values on the column description

Test Plan:
 * mvn test # and wait..
 * create a new table using hbase shell:
   * create 'mytesttable', {NAME=>'CF1'}, {NAME=>'CF2'}
 * open http://localhost:16010/table.jsp?name=mytesttable
 * check the "Table Schema" appears and lists the columns correctly

Reviewers: eclark, vicka.dudin

Differential Revision: https://reviews.facebook.net/D38649

Signed-off-by: Elliott Clark <eclark@apache.org>


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

Branch: refs/heads/branch-1
Commit: e7efa23d0747755b4539a65a39d66764150fc74e
Parents: f5ae21e
Author: Joao Girao <jgirao@fb.com>
Authored: Thu May 28 17:07:25 2015 -0700
Committer: Sean Busbey <busbey@apache.org>
Committed: Tue Feb 21 23:22:55 2017 -0600

----------------------------------------------------------------------
 .../resources/hbase-webapps/master/table.jsp    | 40 ++++++++++++++++++++
 1 file changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/e7efa23d/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 7c2770d..6ca818f 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -27,6 +27,7 @@
   import="java.util.Map"
   import="java.util.Collections"
   import="java.util.Comparator"
+  import="java.util.Collection"
   import="org.apache.hadoop.conf.Configuration"
   import="org.apache.hadoop.util.StringUtils"
   import="org.apache.hadoop.hbase.client.HTable"
@@ -37,6 +38,7 @@
   import="org.apache.hadoop.hbase.ServerLoad"
   import="org.apache.hadoop.hbase.RegionLoad"
   import="org.apache.hadoop.hbase.HConstants"
+  import="org.apache.hadoop.hbase.io.ImmutableBytesWritable"
   import="org.apache.hadoop.hbase.master.HMaster" 
   import="org.apache.hadoop.hbase.zookeeper.MetaTableLocator"
   import="org.apache.hadoop.hbase.util.Bytes"
@@ -46,6 +48,7 @@
   import="org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos"
   import="org.apache.hadoop.hbase.protobuf.generated.HBaseProtos"
   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" %>
 <%
@@ -300,6 +303,43 @@ if ( fqtn != null ) {
   </tr>
 <%  } %>
 </table>
+<h2>Table Schema</h2>
+<table class="table table-striped">
+  <tr>
+      <th>Column Name</th>
+      <th></th>
+  </tr>
+  <%
+    Collection<HColumnDescriptor> families = table.getTableDescriptor().getFamilies();
+    for (HColumnDescriptor family: families) {
+  %>
+  <tr>
+    <td><%= family.getNameAsString() %></td>
+    <td>
+    <table class="table table-striped">
+      <tr>
+       <th>Property</th>
+       <th>Value</th>       
+      </tr>
+    <%
+    Map<ImmutableBytesWritable, ImmutableBytesWritable> familyValues = family.getValues();
+    for (ImmutableBytesWritable familyKey: familyValues.keySet()) {
+      final ImmutableBytesWritable familyValue = familyValues.get(familyKey);
+    %>
+      <tr>
+        <td>
+          <%= Bytes.toString(familyKey.get(), familyKey.getOffset(), familyKey.getLength())
%>
+		</td>
+        <td>
+          <%= Bytes.toString(familyValue.get(), familyValue.getOffset(), familyValue.getLength())
%>
+        </td>
+      </tr>
+    <% } %>
+    </table>
+    </td>
+  </tr>
+  <% } %>
+</table>
 <%
   long totalReadReq = 0;
   long totalWriteReq = 0;


Mime
View raw message