-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-27307 Add Move table to Target Group on master web #5027
Open
SiCheng-Zheng
wants to merge
1
commit into
apache:master
Choose a base branch
from
SiCheng-Zheng:HBASE-27307
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+32
−2
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <code>regionInfo</code> | ||
|
@@ -233,7 +238,7 @@ | |
<% return; | ||
} %> | ||
|
||
<% // table split/major compact/compact/merge actions | ||
<% // table split/major compact/compact/merge/move actions | ||
if ( !readOnly && action != null ) { %> | ||
<div class="container-fluid content"> | ||
<div class="row inner_header"> | ||
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On master branch we do not need this any more. Can do this on branch-2 backport? |
||
Set<TableName> tableNameSet = new HashSet<>(); | ||
tableNameSet.add(tableName); | ||
rsGroupAdminClient.moveTables(tableNameSet,key); | ||
%> Move Table group accepted. <% | ||
}%> | ||
<jsp:include page="redirect.jsp" /> | ||
</div> | ||
<% return; | ||
|
@@ -1235,6 +1252,19 @@ Actions: | |
</td> | ||
</form> | ||
</tr> | ||
<tr> | ||
<form method="get"> | ||
<input type="hidden" name="action" value="move"> | ||
<input type="hidden" name="name" value="<%= fqtn %>"> | ||
<td class="centered"> | ||
<input style="font-size: 12pt; width: 10em" type="submit" value="Move" class="btn"> | ||
</td> | ||
<td style="text-align: center;"> | ||
<input type="text" name="key" size="40" placeholder="Target Group (required)"> | ||
</td> | ||
<td>Move table to Target Group</td> | ||
</form> | ||
</tr> | ||
</table> | ||
</center> | ||
</p> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation?