private synchronized void updateRate(double newRps) {
        refill();
        fillRate = Math.max(newRps, MIN_FILL_RATE);
        maxCapacity = Math.max(newRps, MIN_CAPACITY);
        currentCapacity = Math.min(currentCapacity, maxCapacity);
    }
<pre>
_TokenBucketUpdateRate(new_rps)
  # Refill based on our current rate before we update to the new fill rate.
  _TokenBucketRefill()
  fill_rate = max(new_rps, MIN_FILL_RATE)
  max_capacity = max(new_rps, MIN_CAPACITY)
  # When we scale down we can't have a current capacity that exceeds our
  # max_capacity.
  current_capacity = min(current_capacity, max_capacity)
</pre>
aws-java-sdk-core/src/main/java/com/amazonaws/internal/TokenBucket.java