diff --git a/server/src/main/java/com/github/dtprj/dongting/raft/impl/CommitManager.java b/server/src/main/java/com/github/dtprj/dongting/raft/impl/CommitManager.java index 07f5a227..e4e3b38a 100644 --- a/server/src/main/java/com/github/dtprj/dongting/raft/impl/CommitManager.java +++ b/server/src/main/java/com/github/dtprj/dongting/raft/impl/CommitManager.java @@ -69,7 +69,7 @@ public FrameCallResult execute(Void input) { RaftStatusImpl raftStatus = CommitManager.this.raftStatus; long idx = syncForce ? raftStatus.getLastForceLogIndex() : raftStatus.getLastWriteLogIndex(); if (idx > raftStatus.getCommitIndex()) { - CommitManager.this.finish(idx); + CommitManager.this.logFinish(idx); } FiberCondition c = syncForce ? raftStatus.getLogForceFinishCondition() : raftStatus.getLogWriteFinishCondition(); @@ -77,7 +77,7 @@ public FrameCallResult execute(Void input) { } } - public void finish(long lastPersistIndex) { + private void logFinish(long lastPersistIndex) { RaftStatusImpl raftStatus = this.raftStatus; if (lastPersistIndex > raftStatus.getLastLogIndex()) { throw Fiber.fatal(new RaftException("lastPersistIndex > lastLogIndex. lastPersistIndex=" @@ -140,7 +140,7 @@ private static boolean needCommit(long recentMatchIndex, RaftStatusImpl raftStat @SuppressWarnings("ForLoopReplaceableByForEach") - public static boolean needCommit(long currentCommitIndex, long recentMatchIndex, + private static boolean needCommit(long currentCommitIndex, long recentMatchIndex, List servers, int rwQuorum) { if (recentMatchIndex < currentCommitIndex) { return false;