Class AimdLimitConfig.BuilderBase<BUILDER extends AimdLimitConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AimdLimitConfig>

java.lang.Object
io.helidon.common.concurrency.limits.AimdLimitConfig.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
AimdLimitConfig.Builder
Enclosing interface:
AimdLimitConfig

public abstract static class AimdLimitConfig.BuilderBase<BUILDER extends AimdLimitConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AimdLimitConfig> extends Object implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for AimdLimit.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(AimdLimitConfig prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(AimdLimitConfig.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface Prototype.ConfiguredBuilder<BUILDER extends AimdLimitConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends AimdLimitConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • backoffRatio

      public BUILDER backoffRatio(double backoffRatio)
      Backoff ratio to use for the algorithm. The value must be within [0.5, 1.0).
      Parameters:
      backoffRatio - backoff ratio
      Returns:
      updated builder instance
      See Also:
    • initialLimit

      public BUILDER initialLimit(int initialLimit)
      Initial limit. The value must be within [minLimit(), maxLimit()].
      Parameters:
      initialLimit - initial limit
      Returns:
      updated builder instance
      See Also:
    • maxLimit

      public BUILDER maxLimit(int maxLimit)
      Maximal limit. The value must be same or higher than minLimit().
      Parameters:
      maxLimit - maximal limit
      Returns:
      updated builder instance
      See Also:
    • minLimit

      public BUILDER minLimit(int minLimit)
      Minimal limit. The value must be same or lower than maxLimit().
      Parameters:
      minLimit - minimal limit
      Returns:
      updated builder instance
      See Also:
    • timeout

      public BUILDER timeout(Duration timeout)
      Timeout that when exceeded is the same as if the task failed.
      Parameters:
      timeout - task timeout, defaults to 5 seconds
      Returns:
      updated builder instance
      See Also:
    • clearClock

      public BUILDER clearClock()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • clock

      public BUILDER clock(Supplier<Long> clock)
      A clock that supplies nanosecond time.
      Parameters:
      clock - supplier of current nanoseconds, defaults to System.nanoTime()
      Returns:
      updated builder instance
      See Also:
    • name

      public BUILDER name(String name)
      Name of this instance.
      Parameters:
      name - name of the instance
      Returns:
      updated builder instance
      See Also:
    • backoffRatio

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

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

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

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

      public Duration timeout()
      Timeout that when exceeded is the same as if the task failed.
      Returns:
      the timeout
    • clock

      public Optional<Supplier<Long>> clock()
      A clock that supplies nanosecond time.
      Returns:
      the clock
    • name

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

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.