bharatviswa504 commented on a change in pull request #300:
URL: https://github.com/apache/incubator-ratis/pull/300#discussion_r530719682



##########
File path: 
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java
##########
@@ -593,6 +593,30 @@ public boolean isLeaderReady() {
     return true;
   }
 
+  /**
+   * Return status of the RaftServer.
+   * @return LeaderStatus
+   */
+  public ServerStatus getServerStatus() {

Review comment:
       Because in OM HA, we want to check isLeaderReady and then start serving 
read requests. 
   https://issues.apache.org/jira/browse/HDDS-4484
   
   The main reason was not to call multiple time getImpl(groupID), as now 
isLeader and isLeaderReady both need to call getImpl. When this proposed API, 
we can only once getImpl(groupID) and get server status.
   
   We use RaftServer Builder build() to construct and use that object to make 
calls to Ratis.
   
   
   ```
       this.server = RaftServer.newBuilder()
           .setServerId(this.raftPeerId)
           .setGroup(this.raftGroup)
           .setProperties(serverProperties)
           .setStateMachine(omStateMachine)
           .build();
   
   
   ```
   Let me know what would be the proper way to expose this information from 
Ratis? By adding it to RaftServer?
   
   https://issues.apache.org/jira/browse/HDDS-4484 Jira in Ozone for OM HA.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to