paul-rogers commented on a change in pull request #2000: DRILL-7607: support 
dynamic credit based flow control
URL: https://github.com/apache/drill/pull/2000#discussion_r385996789
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/rpc/data/AckSender.java
 ##########
 @@ -56,8 +60,27 @@ void clear() {
    * response upstream.
    */
   public void sendOk() {
+    sendOk(Acks.NO_SUGGESTED_CREDIT);
+  }
+
+  /**
+   * Decrement the number of references still holding on to this response. 
When the number of references hit zero, send
+   * response upstream. Ack for the dynamic credit model
+   * credit == -1 means Fail
+   * @param credit
+   */
+  public void sendOk(int credit) {
+    everLargestAdviceCredit = credit > everLargestAdviceCredit ? credit : 
everLargestAdviceCredit;
 
 Review comment:
   This might be a bit clearer:
   ```
   everLargestAdviceCredit = Math.max(everLargestAdviceCredit, credit);
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to