hemantk-12 commented on code in PR #5923:
URL: https://github.com/apache/ozone/pull/5923#discussion_r1443180770
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/ratis/RatisHelper.java:
##########
@@ -603,4 +610,32 @@ private static void resetPriorities(RaftGroup original,
RaftClient client) {
// Not re-thrown in order to keep the main exception, if there is any.
}
}
+
+ /**
+ * Similar to {@link JavaUtils#attemptUntilTrue(BooleanSupplier, int,
TimeDuration, String, Logger)},
+ * but:
+ * <li>takes max. {@link Duration} instead of number of attempts</li>
+ * <li>accepts {@link Duration} instead of {@link TimeDuration} for sleep
time</li>
+ *
+ * @return true if attempt was successful,
+ * false if wait for condition to become true timed out or was interrupted
+ */
+ public static boolean attemptUntilTrue(BooleanSupplier condition, Duration
pollInterval, Duration timeout) {
Review Comment:
nit: I think we should add it to
[HddsUtils](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/HddsUtils.java)
or
[JavaUtils](https://github.com/apache/ozone/blob/master/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/JavaUtils.java).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]