protected static long getScanReadConsumeEstimate(long blockSizeBytes, long nextCallSeq,
    long maxScannerResultSize, long maxBlockBytesScanned, long prevBlockBytesScannedDifference) {
    /*
     * Estimating scan workload is more complicated, and if we severely underestimate workloads then
     * throttled clients will exhaust retries too quickly, and could saturate the RPC layer
     */
    if (nextCallSeq == 0) {
      // start scanners with an optimistic 1 block IO estimate
      // it is better to underestimate a large scan in the beginning
      // than to overestimate, and block, a small scan
      return blockSizeBytes;
    }

    boolean isWorkloadGrowing = prevBlockBytesScannedDifference > blockSizeBytes;
    if (isWorkloadGrowing) {
      // if nextCallSeq > 0 and the workload is growing then our estimate
      // should consider that the workload may continue to increase
      return Math.min(maxScannerResultSize, nextCallSeq * maxBlockBytesScanned);
    } else {
      // if nextCallSeq > 0 and the workload is shrinking or flat
      // then our workload has likely plateaued. We can just rely on the existing
      // maxBlockBytesScanned as our estimate in this case.
      return maxBlockBytesScanned;
    }
  }
Update estimate quota(read/write size/capacityUnits) which will be consumed
@param scanRequest                     the scan to be executed
@param maxScannerResultSize            the maximum bytes to be returned by the scanner
@param maxBlockBytesScanned            the maximum bytes scanned in a single RPC call by the
                                       scanner
@param prevBlockBytesScannedDifference the difference between BBS of the previous two next
                                       calls
hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/DefaultOperationQuota.java