szetszwo commented on code in PR #1469:
URL: https://github.com/apache/ratis/pull/1469#discussion_r3314158984
##########
ratis-server-api/src/main/java/org/apache/ratis/statemachine/StateMachine.java:
##########
@@ -116,6 +116,18 @@ default CompletableFuture<DataStream>
stream(RaftClientRequest request) {
return CompletableFuture.completedFuture(null);
}
+ /**
+ * Stream a read-only state machine request. Implementations may write
zero or more data
+ * chunks before completing the returned future with the terminal reply
message.
+ *
+ * @param request the read-only client request
+ * @param stream the output stream for response data chunks
+ * @return a future for the terminal reply message
+ */
+ default CompletableFuture<Message> streamReadOnly(RaftClientRequest
request, DataChannel stream) {
Review Comment:
This method should be similar to query(Message):
```java
/**
* Similar to {@link #query(Message)} except below:
* - In {@link #query(Message)}, the state machine returns the result in
a future.
* - In this method, the state machine sends the result using the given
stream.
*
* @param request the client request
* @param stream the output stream to send the result. The state
machine must close the stream at the end.
*/
default void query(Message request, DataChannel stream) {
}
```
--
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]