Class RoundRobinLoadBalancingPolicyBuilder

java.lang.Object
io.servicetalk.loadbalancer.RoundRobinLoadBalancingPolicyBuilder

public final class RoundRobinLoadBalancingPolicyBuilder extends Object
A builder for RoundRobinLoadBalancingPolicy instances.
See Also:
  • Method Details

    • failOpen

      public RoundRobinLoadBalancingPolicyBuilder failOpen(boolean failOpen)
      Set whether the selector should fail-open in the event no healthy hosts are found.

      When a load balancing policy is configured to fail-open and is unable to find a healthy host, it will attempt to select or establish a connection from an arbitrary host even if it is unlikely to return a healthy session.

      Defaults to false.

      Parameters:
      failOpen - if true, will attempt to select or establish a connection from an arbitrary host even if it is unlikely to return a healthy session.
      Returns:
      this
    • ignoreWeights

      public RoundRobinLoadBalancingPolicyBuilder ignoreWeights(boolean ignoreWeights)
      Set whether the host selector should ignore Hosts weight.

      Host weight influences the probability it will be selected to serve a request. The host weight can come from many sources including known host capacity, priority groups, and others, so ignoring weight information can lead to other features not working properly and should be used with care.

      Defaults to false.

      Parameters:
      ignoreWeights - whether the host selector should ignore host weight information.
      Returns:
      this
    • build

      public <ResolvedAddress, C extends LoadBalancedConnection> LoadBalancingPolicy<ResolvedAddress,C> build()
      Construct the RoundRobinLoadBalancingPolicy.
      Type Parameters:
      ResolvedAddress - the type of the resolved address.
      C - the refined type of the LoadBalancedConnection.
      Returns:
      the concrete RoundRobinLoadBalancingPolicy.