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/10/15 01:19:39 UTC

[GitHub] [incubator-ratis] szetszwo commented on a change in pull request #224: RATIS-1097. DataStreamOutputImpl should use streamOffset instead of messageId

szetszwo commented on a change in pull request #224:
URL: https://github.com/apache/incubator-ratis/pull/224#discussion_r505108992



##########
File path: ratis-client/src/main/java/org/apache/ratis/client/impl/OrderedStreamAsync.java
##########
@@ -94,42 +74,28 @@ public void fail(Throwable e) {
     public CompletableFuture<DataStreamReply> getReplyFuture(){
       return replyFuture;
     }
-
-    public DataStreamWindowRequest(long streamId, long messageId,
-                                 long seqNum, ByteBuffer data){
-      this.streamId = streamId;
-      this.messageId = messageId;
-      this.data = data.slice();
-      this.seqNum = seqNum;
-    }
   }
 
-  private SlidingWindow.Client<DataStreamWindowRequest, DataStreamReply> slidingWindow;
-  private Semaphore requestSemaphore;
-  private DataStreamClientRpc dataStreamClientRpc;
+  private final DataStreamClientRpc dataStreamClientRpc;
+  private final SlidingWindow.Client<DataStreamWindowRequest, DataStreamReply> slidingWindow;
+  private final Semaphore requestSemaphore;
 
-  public OrderedStreamAsync(DataStreamClientRpc dataStreamClientRpc,
-                            RaftProperties properties){
+  OrderedStreamAsync(ClientId clientId, DataStreamClientRpc dataStreamClientRpc, RaftProperties properties){
     this.dataStreamClientRpc = dataStreamClientRpc;
+    this.slidingWindow = new SlidingWindow.Client<>(clientId);
     this.requestSemaphore = new Semaphore(RaftClientConfigKeys.Async.outstandingRequestsMax(properties)*2);

Review comment:
       It was an experimental result.  Indeed, we should use a new conf instead of reusing RaftClientConfigKeys.Async.OUTSTANDING_REQUESTS_MAX_KEY.  Will change it to use the new RaftClientConfigKeys.DataStream.OUTSTANDING_REQUESTS_MAX_KEY.
   




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