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 00:37:14 UTC

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

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



##########
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:
       Sorry, one question unrelated to this patch: why multiple 2 here ?




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