You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/11/14 12:27:33 UTC

[GitHub] [rocketmq] azhsmesos commented on issue #5021: Add flow Control for master-slave replication

azhsmesos commented on issue #5021:
URL: https://github.com/apache/rocketmq/issues/5021#issuecomment-1313616627

   `FlowMonitor` 
   ```java
    public int canTransferMaxByteNum() {
           //Flow control is not started at present
           if (this.isFlowControlEnable()) {
               long res = Math.max(this.maxTransferByteInSecond() - this.transferredByte.get(), 0);
               return res > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) res;
           }
           return Integer.MAX_VALUE;
       }
   ```
   
   if `this.maxTransferByteInSecond() - this.transferredByte.get() < 0` ,the `res` is always going to be 0


-- 
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: commits-unsubscribe@rocketmq.apache.org

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