szetszwo commented on code in PR #1070:
URL: https://github.com/apache/ratis/pull/1070#discussion_r1581179102


##########
ratis-server-api/src/main/java/org/apache/ratis/server/RaftServerConfigKeys.java:
##########
@@ -77,18 +77,28 @@ static TimeDuration sleepDeviationThreshold(RaftProperties 
properties) {
     return 
getTimeDuration(properties.getTimeDuration(SLEEP_DEVIATION_THRESHOLD_DEFAULT.getUnit()),
         SLEEP_DEVIATION_THRESHOLD_KEY, SLEEP_DEVIATION_THRESHOLD_DEFAULT, 
getDefaultLog());
   }
+  /** @deprecated use {@link #setSleepDeviationThreshold(RaftProperties, 
TimeDuration)}. */
+  @Deprecated
   static void setSleepDeviationThreshold(RaftProperties properties, int 
thresholdMs) {
     setInt(properties::setInt, SLEEP_DEVIATION_THRESHOLD_KEY, thresholdMs);
   }
+  static void setSleepDeviationThreshold(RaftProperties properties, 
TimeDuration threshold) {
+    setTimeDuration(properties::setTimeDuration, 
SLEEP_DEVIATION_THRESHOLD_KEY, threshold);
+  }
 
   String CLOSE_THRESHOLD_KEY = PREFIX + ".close.threshold";
   TimeDuration CLOSE_THRESHOLD_DEFAULT = TimeDuration.valueOf(60, 
TimeUnit.SECONDS);
   static TimeDuration closeThreshold(RaftProperties properties) {
     return 
getTimeDuration(properties.getTimeDuration(CLOSE_THRESHOLD_DEFAULT.getUnit()),
         CLOSE_THRESHOLD_KEY, CLOSE_THRESHOLD_DEFAULT, getDefaultLog());
   }
-  static void setCloseThreshold(RaftProperties properties, int thresholdMs) {
-    setInt(properties::setInt, CLOSE_THRESHOLD_KEY, thresholdMs);
+  /** @deprecated use {@link #setCloseThreshold(RaftProperties, 
TimeDuration)}. */
+  @Deprecated
+  static void setCloseThreshold(RaftProperties properties, int thresholdSec) {
+    setInt(properties::setInt, CLOSE_THRESHOLD_KEY, thresholdSec);

Review Comment:
   👍 to rename it to sec.



-- 
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]

Reply via email to