OneSizeFitsQuorum commented on code in PR #640:
URL: https://github.com/apache/ratis/pull/640#discussion_r867366564


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -113,9 +113,14 @@ public boolean isLeaderReady() {
       return isLeader() && getRole().isLeaderReady();
     }
 
+    @Override
+    public RaftPeer getCurrentLeader() {
+      return getRaftConf().getPeer(getState().getLeaderId());
+    }
+
     @Override
     public LifeCycle.State getLifeCycleState() {
-      return lifeCycle.getCurrentState();
+      return getLifeCycle().getCurrentState();

Review Comment:
   Fixed



##########
ratis-server-api/src/main/java/org/apache/ratis/server/DivisionInfo.java:
##########
@@ -51,6 +52,10 @@ default boolean isListener() {
   /** Is this server division currently the leader and ready? */
   boolean isLeaderReady();
 
+  /** @return the current leader of this server division, null means either 
there is
+   * no leader for this term yet or this server division does not know who it 
is yet */
+  RaftPeer getCurrentLeader();

Review Comment:
   Fixed



-- 
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]

Reply via email to