SzyWilliam commented on code in PR #700:
URL: https://github.com/apache/ratis/pull/700#discussion_r939539761
##########
ratis-server-api/src/main/java/org/apache/ratis/server/RaftServerConfigKeys.java:
##########
@@ -157,6 +157,42 @@ static void setClientSize(RaftProperties properties, int
port) {
}
}
+ interface Read {
+ String PREFIX = RaftServerConfigKeys.PREFIX
+ + "." + JavaUtils.getClassSimpleName(Read.class).toLowerCase();
+
+ String TIMEOUT_KEY = PREFIX + ".timeout";
+ TimeDuration TIMEOUT_DEFAULT = TimeDuration.valueOf(10, TimeUnit.SECONDS);
+ static TimeDuration timeout(RaftProperties properties) {
+ return
getTimeDuration(properties.getTimeDuration(TIMEOUT_DEFAULT.getUnit()),
+ TIMEOUT_KEY, TIMEOUT_DEFAULT, getDefaultLog(), requirePositive());
+ }
+ static void setTimeout(RaftProperties properties, TimeDuration
readOnlyTimeout) {
+ setTimeDuration(properties::setTimeDuration, TIMEOUT_KEY,
readOnlyTimeout);
+ }
+
+ enum ReadOption {
Review Comment:
done
--
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]