All Superinterfaces:
Prototype.Api, Prototype.Factory<AimdLimit>
All Known Implementing Classes:
AimdLimitConfig.BuilderBase.AimdLimitConfigImpl

public interface AimdLimitConfig extends Prototype.Api
Configuration of AimdLimit.
See Also:
  • Method Details

    • builder

      static AimdLimitConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static AimdLimitConfig.Builder builder(AimdLimitConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static AimdLimitConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static AimdLimitConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • backoffRatio

      double backoffRatio()
      Backoff ratio to use for the algorithm. The value must be within [0.5, 1.0).
      Returns:
      backoff ratio
    • initialLimit

      int initialLimit()
      Initial limit. The value must be within [minLimit(), maxLimit()].
      Returns:
      initial limit
    • maxLimit

      int maxLimit()
      Maximal limit. The value must be same or higher than minLimit().
      Returns:
      maximal limit
    • minLimit

      int minLimit()
      Minimal limit. The value must be same or lower than maxLimit().
      Returns:
      minimal limit
    • timeout

      Duration timeout()
      Timeout that when exceeded is the same as if the task failed.
      Returns:
      task timeout, defaults to 5 seconds
    • clock

      A clock that supplies nanosecond time.
      Returns:
      supplier of current nanoseconds, defaults to System.nanoTime()
    • name

      String name()
      Name of this instance.
      Returns:
      name of the instance
    • queueLength

      int queueLength()
      How many requests can be enqueued waiting for a permit after the max limit is reached. Note that this may not be an exact behavior due to concurrent invocations. We use Semaphore.getQueueLength() in the AimdLimit implementation. Default value is 0. If set to {code 0}, there is no queueing.
      Returns:
      number of requests to enqueue
    • queueTimeout

      Duration queueTimeout()
      How long to wait for a permit when enqueued. Defaults to "PT1S"
      Returns:
      duration of the timeout
    • fair

      boolean fair()
      Whether the Semaphore should be Semaphore.isFair(). Defaults to false.
      Returns:
      whether this should be a fair semaphore
    • enableMetrics

      boolean enableMetrics()
      Whether to collect metrics for the AIMD implementation.
      Returns:
      metrics flag