szetszwo commented on code in PR #906:
URL: https://github.com/apache/ratis/pull/906#discussion_r1336143119


##########
ratis-server-api/src/main/java/org/apache/ratis/statemachine/StateMachine.java:
##########
@@ -228,6 +228,11 @@ default void notifyFollowerSlowness(RoleInfoProto 
leaderInfo) {}
      * Notify {@link StateMachine} that this server is no longer the leader.
      */
     default void notifyNotLeader(Collection<TransactionContext> 
pendingEntries) throws IOException {}
+
+    /**
+     * Notify the {@link StateMachine} that this server becomes ready after 
changed to leader.
+     */
+    default void notifyLeaderReady() {}

Review Comment:
   We have a `notifyLeaderChanged(..)` method in `EventApi`.  So, both the 
Leader and the Followers will get this event.  Of course, the server could 
check if it becomes the leader by checking the `newLeaderId` parameter.
   
   This method `LeaderEventApi.notifyLeaderReady()` is in `LeaderEventApi`.  
So, only the Leader will get this event.  The name looks good to me.  Also, the 
javadoc is clear.
   ```java
       /**
        * Notify the {@link StateMachine} that this server becomes ready after 
changed to leader.
        */
       default void notifyLeaderReady() {}
   ```



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