szetszwo commented on code in PR #1072:
URL: https://github.com/apache/ratis/pull/1072#discussion_r1600428582
##########
ratis-server-api/src/main/java/org/apache/ratis/statemachine/StateMachine.java:
##########
@@ -266,6 +266,13 @@ default void notifySnapshotInstalled(InstallSnapshotResult
result, long snapshot
* Notify the {@link StateMachine} that a raft server has step down.
*/
default void notifyServerShutdown(RoleInfoProto roleInfo) {}
Review Comment:
We should deprecate the old method and change its default to
```java
/**
* The same as notifyServerShutdown(roleInfo, false).
*
* @deprecated Implementations should override {@link
#notifyServerShutdown(RoleInfoProto, boolean)} instead.
*/
@Deprecated
default void notifyServerShutdown(RoleInfoProto roleInfo) {
notifyServerShutdown(roleInfo, false);
}
```
Could you also update the caller?
```java
+++
b/ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderElection.java
@@ -334,7 +334,7 @@ class LeaderElection implements Runnable {
case NOT_IN_CONF:
case SHUTDOWN:
server.close();
-
server.getStateMachine().event().notifyServerShutdown(server.getRoleInfoProto());
+
server.getStateMachine().event().notifyServerShutdown(server.getRoleInfoProto(),
false);
return false;
case TIMEOUT:
```
##########
ratis-server-api/src/main/java/org/apache/ratis/statemachine/StateMachine.java:
##########
@@ -266,6 +266,13 @@ default void notifySnapshotInstalled(InstallSnapshotResult
result, long snapshot
* Notify the {@link StateMachine} that a raft server has step down.
*/
default void notifyServerShutdown(RoleInfoProto roleInfo) {}
+
+ /**
+ * Notify the {@link StateMachine} that a raft server has been shutdown
down.
Review Comment:
`a raft server` seems inaccurate. How about the following ?
```java
* Notify the {@link StateMachine} that either the server for this
division or all the servers have been shut down.
```
--
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]