Skip to content

Commit

Permalink
Refactor:
Browse files Browse the repository at this point in the history
Rename Method name to more readable and understandable name.
  • Loading branch information
JAYDIPSINH27 committed Mar 31, 2024
1 parent 70f514d commit 637409d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ private boolean isLeaderLeaseValid() {
if (checkLeaderLease(monotonicNowMs)) {
return true;
}
checkDeadNodes0(this.conf.getConf().getPeers(), monotonicNowMs, false, null);
checkAndUpdateLeaderWithDeadNodes(this.conf.getConf().getPeers(), monotonicNowMs, false, null);
return checkLeaderLease(monotonicNowMs);
}

Expand Down Expand Up @@ -2224,7 +2224,7 @@ private boolean checkDeadNodes(final Configuration conf, final long monotonicNow
// Ensure quorum nodes alive.
final List<PeerId> peers = conf.listPeers();
final Configuration deadNodes = new Configuration();
if (checkDeadNodes0(peers, monotonicNowMs, true, deadNodes)) {
if (checkAndUpdateLeaderWithDeadNodes(peers, monotonicNowMs, true, deadNodes)) {
return true;
}
if (stepDownOnCheckFail) {
Expand All @@ -2238,8 +2238,8 @@ private boolean checkDeadNodes(final Configuration conf, final long monotonicNow
return false;
}

private boolean checkDeadNodes0(final List<PeerId> peers, final long monotonicNowMs, final boolean checkReplicator,
final Configuration deadNodes) {
private boolean checkAndUpdateLeaderWithDeadNodes(final List<PeerId> peers, final long monotonicNowMs,
final boolean checkReplicator, final Configuration deadNodes) {
final int leaderLeaseTimeoutMs = this.options.getLeaderLeaseTimeoutMs();
int aliveCount = 0;
long startLease = Long.MAX_VALUE;
Expand Down

0 comments on commit 637409d

Please sign in to comment.