junegunn commented on code in PR #6951:
URL: https://github.com/apache/hbase/pull/6951#discussion_r2073270852
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ModifyTableProcedure.java:
##########
@@ -231,10 +232,19 @@ protected Flow executeFromState(final MasterProcedureEnv
env, final ModifyTableS
case MODIFY_TABLE_REOPEN_ALL_REGIONS:
if (isTableEnabled(env)) {
Configuration conf = env.getMasterConfiguration();
- long backoffMillis =
conf.getLong(PROGRESSIVE_BATCH_BACKOFF_MILLIS_KEY,
- PROGRESSIVE_BATCH_BACKOFF_MILLIS_DEFAULT);
+ // Use table configuration if defined
+ final TableDescriptor descriptor =
+
env.getMasterServices().getTableDescriptors().get(getTableName());
+ long backoffMillis =
+
Optional.ofNullable(descriptor.getValue(PROGRESSIVE_BATCH_BACKOFF_MILLIS_KEY))
+ .map(Long::parseLong)
+ .orElseGet(() ->
conf.getLong(PROGRESSIVE_BATCH_BACKOFF_MILLIS_KEY,
+ PROGRESSIVE_BATCH_BACKOFF_MILLIS_DEFAULT));
int batchSizeMax =
- conf.getInt(PROGRESSIVE_BATCH_SIZE_MAX_KEY,
PROGRESSIVE_BATCH_SIZE_MAX_DISABLED);
+
Optional.ofNullable(descriptor.getValue(PROGRESSIVE_BATCH_SIZE_MAX_KEY))
+ .map(Integer::parseInt).orElseGet(() ->
conf.getInt(PROGRESSIVE_BATCH_SIZE_MAX_KEY,
+ PROGRESSIVE_BATCH_SIZE_MAX_DISABLED));
+
Review Comment:
Refactored the code and added a simple test case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]