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/10/06 04:27:25 UTC

[GitHub] [ratis] szetszwo commented on a diff in pull request #755: RATIS-1714. Support unordered async read.

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


##########
ratis-client/src/main/java/org/apache/ratis/client/api/AsyncApi.java:
##########
@@ -45,14 +46,24 @@ default CompletableFuture<RaftClientReply> sendReadOnly(Message message) {
     return sendReadOnly(message, null);
   }
 
+  /** The same as sendReadOnly(message, server, true). */
+  default CompletableFuture<RaftClientReply> sendReadOnly(Message message, RaftPeerId server) {
+    return sendReadOnly(message, server, true);
+  }
+
   /**
    * Send the given readonly message asynchronously to the raft service.
+   * <p>
+   * The messages may be either ordered or unordered.
+   * For ordered messages, the reply futures are completed in the same order of the messages being sent.
+   * For unordered messages, the reply futures are completed in an arbitrary order.
    *
    * @param message The request message.
    * @param server The target server.  When server == null, send the message to the leader.
+   * @param ordered Are the messages ordered?
    * @return a future of the reply.
    */
-  CompletableFuture<RaftClientReply> sendReadOnly(Message message, RaftPeerId server);
+  CompletableFuture<RaftClientReply> sendReadOnly(Message message, RaftPeerId server, boolean ordered);

Review Comment:
   > Or two sendReadOnlyUnordered ...
   
   This is a good idea.  Let me update it.



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