You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/02/04 10:19:08 UTC

[GitHub] [ratis] szetszwo commented on a change in pull request #594: RATIS-1511. Add setLeaderElection grpc and client related code

szetszwo commented on a change in pull request #594:
URL: https://github.com/apache/ratis/pull/594#discussion_r799335301



##########
File path: ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java
##########
@@ -546,9 +546,19 @@ public RaftClientReply snapshotManagement(SnapshotManagementRequest request) thr
         .thenCompose(impl -> impl.executeSubmitServerRequestAsync(() -> impl.takeSnapshotAsync(request)));
   }
 
-  public CompletableFuture<RaftClientReply> setLeaderElectionAsync(LeaderElectionRequest request) {
+  @Override
+  public RaftClientReply leaderElectionManagement(LeaderElectionManagementRequest request) throws IOException {
+    return RaftServerImpl.waitForReply(getId(), request, leaderElectionManagementAsync(request),
+        e -> RaftClientReply.newBuilder()
+            .setRequest(request)
+            .setException(e)
+            .build());
+  }
+
+  public CompletableFuture<RaftClientReply> leaderElectionManagementAsync(

Review comment:
       Let's add   @Override.
   

##########
File path: ratis-client/src/main/java/org/apache/ratis/client/RaftClient.java
##########
@@ -64,6 +65,9 @@
   /** Get the {@link SnapshotManagementApi} for the given server. */
   SnapshotManagementApi getSnapshotManagementApi(RaftPeerId server);
 
+  /** Get the {@link LeaderElectionManagementApi} for the given server. */
+  LeaderElectionManagementApi leaderElectionManagementApi(RaftPeerId server);

Review comment:
       Let's call this getLeaderElectionManagementApi since the other method names start with "get".




-- 
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: issues-unsubscribe@ratis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org