You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2019/07/29 22:14:54 UTC

[hbase] branch branch-2 updated (4a83de7 -> d23236a)

This is an automated email from the ASF dual-hosted git repository.

stack pushed a change to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git.


    from 4a83de7  HBASE-22313 Add method to FsDelegation token to accept token kind (#199)
     new 8b1952a  HBASE-22751 table.jsp fails if ugly regions in table
     new d23236a  HBASE-22751 table.jsp fails if ugly regions in table

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/resources/hbase-webapps/master/table.jsp  | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)


[hbase] 02/02: HBASE-22751 table.jsp fails if ugly regions in table

Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit d23236a4522fafa556ba0e6530fe08e399cd97a0
Author: stack <st...@apache.org>
AuthorDate: Fri Jul 26 21:32:37 2019 -0700

    HBASE-22751 table.jsp fails if ugly regions in table
---
 hbase-server/src/main/resources/hbase-webapps/master/table.jsp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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 e98167e..555ae08 100644
--- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
+++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp
@@ -251,8 +251,7 @@ if (fqtn != null && master.isInitialized()) {
 </tbody>
 </table>
 <%} else {
-  Admin admin = master.getConnection().getAdmin();
-  RegionLocator r = master.getClusterConnection().getRegionLocator(table.getName());
+  RegionLocator r = master.getConnection().getRegionLocator(table.getName());
   try { %>
 <h2>Table Attributes</h2>
 <table class="table table-striped">


[hbase] 01/02: HBASE-22751 table.jsp fails if ugly regions in table

Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git

commit 8b1952a42a6821d22621ba5ee3b5afba4bf72e78
Author: stack <st...@apache.org>
AuthorDate: Fri Jul 26 21:32:37 2019 -0700

    HBASE-22751 table.jsp fails if ugly regions in table
---
 .../src/main/resources/hbase-webapps/master/table.jsp | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

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 c0138ca..e98167e 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.List"
   import="java.util.Map"
   import="java.util.TreeMap"
+  import=" java.util.concurrent.TimeUnit"
   import="org.apache.commons.lang3.StringEscapeUtils"
   import="org.apache.hadoop.conf.Configuration"
   import="org.apache.hadoop.hbase.HColumnDescriptor"
@@ -35,8 +36,10 @@
   import="org.apache.hadoop.hbase.ServerName"
   import="org.apache.hadoop.hbase.TableName"
   import="org.apache.hadoop.hbase.TableNotFoundException"
-  import="org.apache.hadoop.hbase.client.Admin"
+  import="org.apache.hadoop.hbase.client.AsyncAdmin"
+  import="org.apache.hadoop.hbase.client.AsyncConnection"
   import="org.apache.hadoop.hbase.client.CompactionState"
+  import="org.apache.hadoop.hbase.client.ConnectionFactory"
   import="org.apache.hadoop.hbase.client.RegionInfo"
   import="org.apache.hadoop.hbase.client.RegionInfoBuilder"
   import="org.apache.hadoop.hbase.client.RegionLocator"
@@ -117,6 +120,8 @@
       pageTitle = "Table: " + escaped_fqtn;
   }
   pageContext.setAttribute("pageTitle", pageTitle);
+  AsyncConnection connection = ConnectionFactory.createAsyncConnection(master.getConfiguration()).get();
+  AsyncAdmin admin = connection.getAdminBuilder().setOperationTimeout(5, TimeUnit.SECONDS).build();
 %>
 
 <jsp:include page="header.jsp">
@@ -143,7 +148,6 @@ if (fqtn != null && master.isInitialized()) {
         </div>
 <p><hr><p>
 <%
-  try (Admin admin = master.getConnection().getAdmin()) {
     if (action.equals("split")) {
       if (key != null && key.length() > 0) {
         admin.split(TableName.valueOf(fqtn), Bytes.toBytes(key));
@@ -154,7 +158,7 @@ if (fqtn != null && master.isInitialized()) {
     %> Split request accepted. <%
     } else if (action.equals("compact")) {
       if (key != null && key.length() > 0) {
-        List<RegionInfo> regions = admin.getRegions(TableName.valueOf(fqtn));
+        List<RegionInfo> regions = admin.getRegions(TableName.valueOf(fqtn)).get();
         byte[] row = Bytes.toBytes(key);
 
         for (RegionInfo region : regions) {
@@ -172,7 +176,6 @@ if (fqtn != null && master.isInitialized()) {
         }
         %> Merge request accepted. <%
     }
-  }
 %>
 <jsp:include page="redirect.jsp" />
 </div>
@@ -260,7 +263,7 @@ if (fqtn != null && master.isInitialized()) {
   </tr>
   <tr>
       <td>Enabled</td>
-      <td><%= admin.isTableEnabled(table.getName()) %></td>
+      <td><%= admin.isTableEnabled(table.getName()).get() %></td>
       <td>Is the table enabled</td>
   </tr>
   <tr>
@@ -268,7 +271,7 @@ if (fqtn != null && master.isInitialized()) {
       <td>
 <%
   try {
-    CompactionState compactionState = admin.getCompactionState(table.getName());
+    CompactionState compactionState = admin.getCompactionState(table.getName()).get();
 %>
 <%= compactionState %>
 <%
@@ -503,7 +506,7 @@ if (fqtn != null && master.isInitialized()) {
   if (urlRegionServer != null) {
   %>
   <td>
-     <a href="<%= urlRegionServer %>"><%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %></a>
+     <a href="<%= urlRegionServer %>"><%= addr == null? "-": StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %></a>
   </td>
   <%
   } else {
@@ -577,7 +580,7 @@ if (withReplica) {
     %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><%
   }
 } finally {
-  admin.close();
+  connection.close();
 }
 } // end else
 %>