EdColeman commented on code in PR #3231:
URL: https://github.com/apache/accumulo/pull/3231#discussion_r1132430540
##########
server/master/src/main/java/org/apache/accumulo/master/Master.java:
##########
@@ -1489,40 +1490,41 @@ private void blockForTservers() throws
InterruptedException {
tserverSet.size(),
Property.MASTER_STARTUP_TSERVER_AVAIL_MIN_COUNT.getKey());
return;
}
- long maxWait = TimeUnit.MILLISECONDS
-
.toNanos(accConfig.getTimeInMillis(Property.MASTER_STARTUP_TSERVER_AVAIL_MAX_WAIT));
+ long maxWait =
accConfig.getTimeInMillis(Property.MASTER_STARTUP_TSERVER_AVAIL_MAX_WAIT);
if (maxWait <= 0) {
log.info("tserver availability check set to block indefinitely, To
change, set {} > 0.",
Property.MASTER_STARTUP_TSERVER_AVAIL_MAX_WAIT.getKey());
maxWait = Long.MAX_VALUE;
}
- long sleepInterval = maxWait / 10;
- // Set an incremental logging delay of 15 seconds.
- long logIncrement = TimeUnit.SECONDS.toNanos(15);
- long logWait = 0;
- long lastLog = 0;
+ long retries = 10;
+ long waitPeriod = maxWait / retries;
+
+ Retry tserverRetry =
+ Retry.builder().maxRetries(retries).retryAfter(waitPeriod,
TimeUnit.MILLISECONDS)
+ .incrementBy(0, TimeUnit.MILLISECONDS).maxWait(waitPeriod,
TimeUnit.MILLISECONDS)
+ .logInterval(30_000, TimeUnit.MILLISECONDS).createRetry();
Review Comment:
just a nit - you can static import `TimeUnit.MILLISECONDS` so these are
shorten to `MILLISECONDS`
--
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]