szetszwo commented on code in PR #1332:
URL: https://github.com/apache/ratis/pull/1332#discussion_r2673259060
##########
ratis-server-api/src/main/java/org/apache/ratis/server/RaftServerConfigKeys.java:
##########
@@ -265,6 +265,21 @@ static void setWriteIndexCacheExpiryTime(RaftProperties
properties, TimeDuration
setTimeDuration(properties::setTimeDuration,
WRITE_INDEX_CACHE_EXPIRY_TIME_KEY, expiryTime);
}
}
+
+ interface ReadIndex {
+ String PREFIX = Read.PREFIX + ".read-index";
+
+ String READ_INDEX_APPLIED_INDEX_ENABLED_KEY = PREFIX +
".applied-index.enabled";
+ boolean READ_INDEX_APPLIED_INDEX_ENABLED_DEFAULT = false;
+ static boolean readIndexAppliedIndexEnabled(RaftProperties properties) {
+ return getBoolean(properties::getBoolean,
READ_INDEX_APPLIED_INDEX_ENABLED_KEY,
+ READ_INDEX_APPLIED_INDEX_ENABLED_DEFAULT, getDefaultLog());
+ }
+
+ static void setReadIndexAppliedIndexEnabled(RaftProperties properties,
boolean enabled) {
+ setBoolean(properties::setBoolean,
READ_INDEX_APPLIED_INDEX_ENABLED_KEY, enabled);
+ }
Review Comment:
Let's remove the "readIndex" prefix from the fields and methods since the
interface name already has it, i.e.
```java
interface ReadIndex {
String PREFIX = Read.PREFIX + ".read-index";
String APPLIED_INDEX_ENABLED_KEY = PREFIX + ".applied-index.enabled";
boolean APPLIED_INDEX_ENABLED_DEFAULT = false;
static boolean appliedIndexEnabled(RaftProperties properties) {
return getBoolean(properties::getBoolean, APPLIED_INDEX_ENABLED_KEY,
APPLIED_INDEX_ENABLED_DEFAULT, getDefaultLog());
}
static void setAppliedIndexEnabled(RaftProperties properties, boolean
enabled) {
setBoolean(properties::setBoolean, APPLIED_INDEX_ENABLED_KEY,
enabled);
}
}
```
(Since this is a public API, we have to be more meticulous.)
--
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]