You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/11/18 03:11:49 UTC

[GitHub] [incubator-ratis] runzhiwang opened a new pull request #284: RATIS-1154. Add sync flag when write stream data

runzhiwang opened a new pull request #284:
URL: https://github.com/apache/incubator-ratis/pull/284


   ## What changes were proposed in this pull request?
   
   Add sync flag when write stream data
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/RATIS-1154
   
   ## How was this patch tested?
   
   new assert


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

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



[GitHub] [incubator-ratis] runzhiwang merged pull request #284: RATIS-1154. Add sync flag when write stream data

Posted by GitBox <gi...@apache.org>.
runzhiwang merged pull request #284:
URL: https://github.com/apache/incubator-ratis/pull/284


   


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

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



[GitHub] [incubator-ratis] szetszwo commented on a change in pull request #284: RATIS-1154. Add sync flag when write stream data

Posted by GitBox <gi...@apache.org>.
szetszwo commented on a change in pull request #284:
URL: https://github.com/apache/incubator-ratis/pull/284#discussion_r525715378



##########
File path: ratis-test/src/test/java/org/apache/ratis/datastream/DataStreamBaseTest.java
##########
@@ -105,8 +106,14 @@ SingleDataStream getSingleDataStream(long callId) {
   static class SingleDataStream implements DataStream {
     private int byteWritten = 0;
     private final RaftClientRequest writeRequest;
+    private boolean isForced = false;

Review comment:
       Let's recorded the forced position.
   ```
   int forcedPosition = 0;
   ```

##########
File path: ratis-client/src/main/java/org/apache/ratis/client/api/DataStreamOutput.java
##########
@@ -26,5 +26,5 @@
 /** An asynchronous output stream supporting zero buffer copying. */
 public interface DataStreamOutput extends CloseAsync<DataStreamReply> {
   /** Send out the data in the buffer asynchronously */
-  CompletableFuture<DataStreamReply> writeAsync(ByteBuffer buf);
+  CompletableFuture<DataStreamReply> writeAsync(ByteBuffer buf, boolean sync);

Review comment:
       We should add one more method
   ```suggestion
     default CompletableFuture<DataStreamReply> writeAsync(ByteBuffer buffer) {
       return writeAsync(buffer, false);
     }
   
     CompletableFuture<DataStreamReply> writeAsync(ByteBuffer buffer, boolean sync);
   ```




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

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



[GitHub] [incubator-ratis] runzhiwang commented on pull request #284: RATIS-1154. Add sync flag when write stream data

Posted by GitBox <gi...@apache.org>.
runzhiwang commented on pull request #284:
URL: https://github.com/apache/incubator-ratis/pull/284#issuecomment-729442910


   @szetszwo Thanks for review. Because CI passed, so I merge 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.

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



[GitHub] [incubator-ratis] runzhiwang closed pull request #284: RATIS-1154. Add sync flag when write stream data

Posted by GitBox <gi...@apache.org>.
runzhiwang closed pull request #284:
URL: https://github.com/apache/incubator-ratis/pull/284


   


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

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



[GitHub] [incubator-ratis] runzhiwang closed pull request #284: RATIS-1154. Add sync flag when write stream data

Posted by GitBox <gi...@apache.org>.
runzhiwang closed pull request #284:
URL: https://github.com/apache/incubator-ratis/pull/284


   


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

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