RateLimitingFactory (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.util, class: RateLimitingFactory

Package org.apache.hadoop.util

# Class RateLimitingFactory

java.lang.Object
org.apache.hadoop.util.RateLimitingFactory

@Private @Unstable public final class RateLimitingFactory extends Object
Factory for Rate Limiting. This should be only place in the code where the guava RateLimiter is imported.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static RateLimiting`
  `create(int capacity)`
  Create an instance.
  `static RateLimiting`
  `unlimitedRate()`
  Get the unlimited rate.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### unlimitedRate

    public static RateLimiting unlimitedRate()
    Get the unlimited rate.
    Returns:
      a rate limiter which always has capacity.

  - ### create

    public static RateLimiting create(int capacity)
    Create an instance. If the rate is 0; return the unlimited rate.
    Parameters:
      `capacity` - capacity in permits/second.
    Returns:
      limiter restricted to the given capacity.