bitflicker64 commented on code in PR #3376:
URL: https://github.com/apache/hugegraph/pull/3376#discussion_r4330744425
##########
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/RaftReflectionUtil.java:
##########
@@ -28,6 +29,39 @@
@Slf4j
public class RaftReflectionUtil {
+ /**
+ * The last index of the node's raft log, read from its log manager;
Long.MAX_VALUE when
+ * it cannot be read, which the caller treats as "unknown"
+ */
+ public static long getLastLogIndex(Node node) {
Review Comment:
Minor: `getLastLogIndex(Node)` has no caller. `RaftEngine.init` reads the
log manager once with `getLogManager` and takes `logManager.getLastLogIndex()`
from it directly, and `RaftReflectionUtilTest` covers only `getLogManager`. Its
javadoc also refers to "the caller" that treats `Long.MAX_VALUE` as unknown,
which does not exist. `grep -rn 'getLastLogIndex(' hugegraph-pd` at 360752ac
finds only this definition and the `logManager.getLastLogIndex()` call in
`RaftEngine`. Please remove the method; `RaftEngine` needs the log manager
itself for `getLogTerm`, so it would not use this helper anyway.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]