szetszwo commented on code in PR #932:
URL: https://github.com/apache/ratis/pull/932#discussion_r1348882703
##########
ratis-client/src/main/java/org/apache/ratis/client/RaftClientConfigKeys.java:
##########
@@ -62,6 +62,15 @@ static void setWatchRequestTimeout(RaftProperties properties,
TimeDuration timeoutDuration) {
setTimeDuration(properties::setTimeDuration, WATCH_REQUEST_TIMEOUT_KEY,
timeoutDuration);
}
+
+ String USE_EPOLL_KEY = PREFIX + ".use-epoll";
+ boolean USE_EPOLL_DEFAULT = true;
+ static boolean useEpoll(RaftProperties properties) {
+ return getBoolean(properties::getBoolean, USE_EPOLL_KEY,
USE_EPOLL_DEFAULT, getDefaultLog());
+ }
+ static void setUseEpoll(RaftProperties properties, boolean enable) {
+ setBoolean(properties::setBoolean, USE_EPOLL_KEY, enable);
+ }
Review Comment:
Since this is a Netty conf, let's move it to `NettyConfigKeys`. We should
create a `Client` section as below:
```java
+++ b/ratis-netty/src/main/java/org/apache/ratis/netty/NettyConfigKeys.java
@@ -76,6 +76,24 @@ public interface NettyConfigKeys {
}
}
+ interface Client {
+ Logger LOG = LoggerFactory.getLogger(Client.class);
+ static Consumer<String> getDefaultLog() {
+ return LOG::debug;
+ }
+
+ String PREFIX = NettyConfigKeys.PREFIX + ".client";
+
+ String USE_EPOLL_KEY = PREFIX + ".use-epoll";
+ boolean USE_EPOLL_DEFAULT = true;
+ static boolean useEpoll(RaftProperties properties) {
+ return getBoolean(properties::getBoolean, USE_EPOLL_KEY,
USE_EPOLL_DEFAULT, getDefaultLog());
+ }
+ static void setUseEpoll(RaftProperties properties, boolean enable) {
+ setBoolean(properties::setBoolean, USE_EPOLL_KEY, enable);
+ }
+ }
+
interface DataStream {
```
--
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]