int guess(int bytesWritten) {
    // if the bytesWritten is greater than the current capacity
    // always increase the capacity in powers of 2.
    if (bytesWritten > this.capacity) {
      // Ensure we don't cross the LIMIT
      if ((this.capacity << 1) <= LIMIT) {
        // increase the capacity in the range of power of 2
        this.capacity = this.capacity << 1;
      }
    } else {
      // if we see that the bytesWritten is lesser we could again decrease
      // the capacity by dividing it by 2 if the bytesWritten is satisfied by
      // that reduction
      if ((this.capacity >> 1) >= bytesWritten) {
        this.capacity = this.capacity >> 1;
      }
    }
    return this.capacity;
  }
Used to predict the next send buffer size.
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/SendBufSizePredictor.java