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 296e0e77f73..0eeff2db086 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,19 @@ import="org.apache.hadoop.hbase.Size" 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.ColumnFamilyDescriptor" import="org.apache.hadoop.hbase.client.CompactionState" + import="org.apache.hadoop.hbase.client.Connection" import="org.apache.hadoop.hbase.client.RegionInfo" import="org.apache.hadoop.hbase.client.RegionInfoBuilder" import="org.apache.hadoop.hbase.client.RegionLocator" import="org.apache.hadoop.hbase.client.RegionReplicaUtil" import="org.apache.hadoop.hbase.client.Table" + import="org.apache.hadoop.hbase.client.TableDescriptor" + import="org.apache.hadoop.hbase.client.TableDescriptorBuilder" import="org.apache.hadoop.hbase.client.TableState" import="org.apache.hadoop.hbase.client.ColumnFamilyDescriptor" import="org.apache.hadoop.hbase.http.InfoServer" @@ -77,6 +81,7 @@ <%@ page import="org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas" %> <%@ page import="org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota" %> <%@ page import="java.util.stream.Collectors" %> +<%@ page import="org.apache.hadoop.hbase.rsgroup.RSGroupAdminClient" %> <%! /** * @return An empty region load stamped with the passed in regionInfo @@ -233,7 +238,7 @@ <% return; } %> -<% // table split/major compact/compact/merge actions +<% // table split/major compact/compact/merge/move actions if ( !readOnly && action != null ) { %>
@@ -282,7 +287,19 @@ admin.mergeRegions(Bytes.toBytesBinary(left), Bytes.toBytesBinary(right), false); } %> Merge request accepted. <% - } %> + } else if (action.equals("move")) { + Connection connect = master.getConnection(); + Admin newAdmin = connect.getAdmin(); + TableName tableName = TableName.valueOf(fqtn); + TableDescriptor td = TableDescriptorBuilder.newBuilder(newAdmin.getDescriptor(tableName)) + .setRegionServerGroup(key).build(); + newAdmin.modifyTable(td); + RSGroupAdminClient rsGroupAdminClient = new RSGroupAdminClient(connect); + Set tableNameSet = new HashSet<>(); + tableNameSet.add(tableName); + rsGroupAdminClient.moveTables(tableNameSet,key); + %> Move Table group accepted. <% + }%>
<% return; @@ -1235,6 +1252,19 @@ Actions: + +
+ + + + + + + + + Move table to Target Group +
+