rmdmattingly commented on code in PR #5534:
URL: https://github.com/apache/hbase/pull/5534#discussion_r1412616954
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/ReopenTableRegionsProcedure.java:
##########
@@ -61,20 +73,43 @@ public class ReopenTableRegionsProcedure
private List<HRegionLocation> regions = Collections.emptyList();
+ private List<HRegionLocation> currentRegionBatch = Collections.emptyList();
+
private RetryCounter retryCounter;
+ private long reopenBatchBackoffMillis;
+ private int reopenBatchSize;
+ private int reopenBatchSizeMax;
+ private long regionsReopened = 0;
+ private long batchesProcessed = 0;
+
public ReopenTableRegionsProcedure() {
- regionNames = Collections.emptyList();
+ this(null);
}
public ReopenTableRegionsProcedure(TableName tableName) {
- this.tableName = tableName;
- this.regionNames = Collections.emptyList();
+ this(tableName, Collections.emptyList());
}
public ReopenTableRegionsProcedure(final TableName tableName, final
List<byte[]> regionNames) {
+ this(tableName, regionNames, PROGRESSIVE_BATCH_BACKOFF_MILLIS_DEFAULT,
+ PROGRESSIVE_BATCH_SIZE_MAX_DISABLED);
+ }
+
+ public ReopenTableRegionsProcedure(final TableName tableName, long
reopenBatchBackoffMillis,
+ int reopenBatchSizeMax) {
+ this(tableName, Collections.emptyList(), reopenBatchBackoffMillis,
reopenBatchSizeMax);
+ }
+
+ public ReopenTableRegionsProcedure(final TableName tableName, final
List<byte[]> regionNames,
+ long reopenBatchBackoffMillis, int reopenBatchSizeMax) {
this.tableName = tableName;
this.regionNames = regionNames;
+ this.reopenBatchBackoffMillis = reopenBatchBackoffMillis;
+ this.reopenBatchSize = reopenBatchSizeMax !=
PROGRESSIVE_BATCH_SIZE_MAX_DISABLED
+ ? 1
+ : PROGRESSIVE_BATCH_SIZE_MAX_DEFAULT_VALUE;
+ this.reopenBatchSizeMax = Math.max(reopenBatchSizeMax,
MINIMUM_BATCH_SIZE_MAX);
Review Comment:
very good catch re: overflow. I've added a test which fails without our
overflow protection
--
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]