You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "whbing (via GitHub)" <gi...@apache.org> on 2024/04/25 16:05:35 UTC
[PR] RATIS-2061. Fix setCloseThreshold parameter in RaftServerConfigKeys [ratis]
whbing opened a new pull request, #1070:
URL: https://github.com/apache/ratis/pull/1070
## What changes were proposed in this pull request?
1. parameter `int thresholdMs` in `RaftServerConfigKeys#setCloseThreshold` is misrepresented as milliseconds while the correct unit is seconds. So fix the unit to TimeDuration.
2. Also fix `setSleepDeviationThreshold` parameter unit to TimeDuration.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2061
## How was this patch tested?
manual tests : It passes the parameter verification in ozone project.
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2061. Fix setCloseThreshold parameter in RaftServerConfigKeys [ratis]
Posted by "whbing (via GitHub)" <gi...@apache.org>.
whbing commented on PR #1070:
URL: https://github.com/apache/ratis/pull/1070#issuecomment-2078582219
Updated. @szetszwo Thanks for review !
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2061. Fix setCloseThreshold parameter in RaftServerConfigKeys [ratis]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] RATIS-2061. Fix setCloseThreshold parameter in RaftServerConfigKeys [ratis]
Posted by "szetszwo (via GitHub)" <gi...@apache.org>.
szetszwo merged PR #1070:
URL: https://github.com/apache/ratis/pull/1070
--
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: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org