-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29782 Expose public Admin API to reopen table regions without moving #7563
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4251,6 +4251,54 @@ protected String getDescription() { | |
|
|
||
| } | ||
|
|
||
| /** | ||
| * Reopen regions provided in the argument. Applies throttling to the procedure to avoid | ||
| * overwhelming the system. This is used by the reopenTableRegions methods in the Admin API via | ||
| * HMaster. | ||
| * @param tableName The current table name | ||
| * @param regionNames The region names of the regions to reopen | ||
| * @param nonceGroup Identifier for the source of the request, a client or process | ||
| * @param nonce A unique identifier for this operation from the client or process identified | ||
| * by <code>nonceGroup</code> (the source must ensure each operation gets a | ||
| * unique id). | ||
| * @return procedure Id | ||
| * @throws IOException if reopening region fails while running procedure | ||
| */ | ||
| long reopenRegionsThrottled(final TableName tableName, final List<byte[]> regionNames, | ||
|
Member
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. Throttling is a net new feature with this change? I'm surprised it's not introduced as a separate feature.
Contributor
Author
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. Throttling has already been implemented in the ReopenTableRegionsProcedure, but for some reason the existing method on HMaster doesn't use it. I didn't want to change the existing implementation so I exposed a new method to allow users to choose - and used it for these changes too.
Member
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. Please file a ticket to report the other flow not making use of this method? We should centralize the implementations if we can. |
||
| final long nonceGroup, final long nonce) throws IOException { | ||
|
|
||
| checkInitialized(); | ||
|
|
||
| if (!tableStateManager.isTablePresent(tableName)) { | ||
| throw new TableNotFoundException(tableName); | ||
| } | ||
|
|
||
| return MasterProcedureUtil | ||
| .submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(this, nonceGroup, nonce) { | ||
| @Override | ||
| protected void run() throws IOException { | ||
| ReopenTableRegionsProcedure proc; | ||
| if (regionNames.isEmpty()) { | ||
| proc = ReopenTableRegionsProcedure.throttled(getConfiguration(), | ||
| getTableDescriptors().get(tableName)); | ||
| } else { | ||
| proc = ReopenTableRegionsProcedure.throttled(getConfiguration(), | ||
| getTableDescriptors().get(tableName), regionNames); | ||
| } | ||
|
|
||
| LOG.info("{} throttled reopening {} regions for table {}", getClientIdAuditPrefix(), | ||
| regionNames.isEmpty() ? "all" : regionNames.size(), tableName); | ||
|
|
||
| submitProcedure(proc); | ||
| } | ||
|
|
||
| @Override | ||
| protected String getDescription() { | ||
| return "Throttled ReopenTableRegionsProcedure for " + tableName; | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| @Override | ||
| public ReplicationPeerManager getReplicationPeerManager() { | ||
| return replicationPeerManager; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.