SzyWilliam commented on code in PR #730:
URL: https://github.com/apache/ratis/pull/730#discussion_r956860997


##########
ratis-server/src/main/java/org/apache/ratis/server/leader/LogAppenderBase.java:
##########
@@ -225,4 +230,14 @@ public InstallSnapshotRequestProto 
newInstallSnapshotNotificationRequest(TermInd
   public Iterable<InstallSnapshotRequestProto> 
newInstallSnapshotRequests(String requestId, SnapshotInfo snapshot) {
     return new InstallSnapshotRequests(server, getFollowerId(), requestId, 
snapshot, snapshotChunkMaxSize);
   }
+
+  @Override
+  public void registerAppendEntriesListener(BiConsumer<RaftPeerId, 
AppendEntriesReplyProto> listener) {
+    appendEntriesListener = listener;
+  }
+
+  protected void notifyAppendEntriesListener(AppendEntriesReplyProto reply) {
+    Optional.ofNullable(appendEntriesListener).ifPresent(
+        listener -> listener.accept(this.getServer().getId(), reply));

Review Comment:
   done



##########
ratis-server-api/src/main/java/org/apache/ratis/server/leader/LogAppender.java:
##########
@@ -169,6 +171,9 @@ default boolean hasAppendEntries() {
   /** send a heartbeat AppendEntries immediately */
   void triggerHeartbeat() throws IOException;
 
+  /** Register an AppendEntries listener */
+  void registerAppendEntriesListener(BiConsumer<RaftPeerId, 
AppendEntriesReplyProto> listener);

Review Comment:
   done



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