Package io.servicetalk.loadbalancer
Class DelegatingLoadBalancerBuilder<ResolvedAddress,C extends LoadBalancedConnection>
java.lang.Object
io.servicetalk.loadbalancer.DelegatingLoadBalancerBuilder<ResolvedAddress,C>
- Type Parameters:
ResolvedAddress
- The resolved address type.C
- The type of connection.
- All Implemented Interfaces:
LoadBalancerBuilder<ResolvedAddress,
C>
public class DelegatingLoadBalancerBuilder<ResolvedAddress,C extends LoadBalancedConnection>
extends Object
implements LoadBalancerBuilder<ResolvedAddress,C>
A
LoadBalancerBuilder
that delegates all methods to another LoadBalancerBuilder
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackgroundExecutor
(Executor backgroundExecutor) Set the backgroundExecutor
to use for determining time and scheduling background tasks such as those associated with outlier detection.build()
Builds theLoadBalancerFactory
configured by this builder.connectionSelectorPolicy
(ConnectionSelectorPolicy<C> connectionSelectorPolicy) Set theConnectionSelectorPolicy
to use with this load balancer.protected final LoadBalancerBuilder<ResolvedAddress,
C> delegate()
Returns theDelegatingLoadBalancerBuilder
delegate.loadBalancerObserver
(LoadBalancerObserverFactory loadBalancerObserverFactory) Set theLoadBalancerObserverFactory
to use with this load balancer.loadBalancingPolicy
(LoadBalancingPolicy<ResolvedAddress, C> loadBalancingPolicy) Set theloadBalancingPolicy
to use with this load balancer.outlierDetectorConfig
(OutlierDetectorConfig outlierDetectorConfig) Set theOutlierDetectorConfig
to use with this load balancer.toString()
-
Constructor Details
-
DelegatingLoadBalancerBuilder
Creates a new builder which delegates to the providedLoadBalancerBuilder
.- Parameters:
delegate
- the delegate builder.
-
-
Method Details
-
delegate
Returns theDelegatingLoadBalancerBuilder
delegate.- Returns:
- Delegate
DelegatingLoadBalancerBuilder
.
-
loadBalancingPolicy
public LoadBalancerBuilder<ResolvedAddress,C> loadBalancingPolicy(LoadBalancingPolicy<ResolvedAddress, C> loadBalancingPolicy) Description copied from interface:LoadBalancerBuilder
Set theloadBalancingPolicy
to use with this load balancer.- Specified by:
loadBalancingPolicy
in interfaceLoadBalancerBuilder<ResolvedAddress,
C extends LoadBalancedConnection> - Parameters:
loadBalancingPolicy
- theloadBalancingPolicy
to use- Returns:
this
-
loadBalancerObserver
public LoadBalancerBuilder<ResolvedAddress,C> loadBalancerObserver(@Nullable LoadBalancerObserverFactory loadBalancerObserverFactory) Description copied from interface:LoadBalancerBuilder
Set theLoadBalancerObserverFactory
to use with this load balancer.- Specified by:
loadBalancerObserver
in interfaceLoadBalancerBuilder<ResolvedAddress,
C extends LoadBalancedConnection> - Parameters:
loadBalancerObserverFactory
- theLoadBalancerObserverFactory
to use, ornull
to not use an observer.- Returns:
- {code this}
-
outlierDetectorConfig
public LoadBalancerBuilder<ResolvedAddress,C> outlierDetectorConfig(OutlierDetectorConfig outlierDetectorConfig) Description copied from interface:LoadBalancerBuilder
Set theOutlierDetectorConfig
to use with this load balancer.The outlier detection system works in conjunction with the load balancing policy to attempt to avoid hosts that have been determined to be unhealthy or slow. The details of the selection process are determined by the
LoadBalancingPolicy
while the health status is determined by the outlier detection configuration.- Specified by:
outlierDetectorConfig
in interfaceLoadBalancerBuilder<ResolvedAddress,
C extends LoadBalancedConnection> - Parameters:
outlierDetectorConfig
- theOutlierDetectorConfig
to use, ornull
to use the default outlier detection.- Returns:
- {code this}
- See Also:
-
backgroundExecutor
Description copied from interface:LoadBalancerBuilder
Set the backgroundExecutor
to use for determining time and scheduling background tasks such as those associated with outlier detection.- Specified by:
backgroundExecutor
in interfaceLoadBalancerBuilder<ResolvedAddress,
C extends LoadBalancedConnection> - Parameters:
backgroundExecutor
-Executor
to use as a time source and for scheduling background tasks.- Returns:
this
.
-
connectionSelectorPolicy
public LoadBalancerBuilder<ResolvedAddress,C> connectionSelectorPolicy(ConnectionSelectorPolicy<C> connectionSelectorPolicy) Description copied from interface:LoadBalancerBuilder
Set theConnectionSelectorPolicy
to use with this load balancer.- Specified by:
connectionSelectorPolicy
in interfaceLoadBalancerBuilder<ResolvedAddress,
C extends LoadBalancedConnection> - Parameters:
connectionSelectorPolicy
- the factory of connection selection strategies to use.- Returns:
this
-
build
Description copied from interface:LoadBalancerBuilder
Builds theLoadBalancerFactory
configured by this builder.- Specified by:
build
in interfaceLoadBalancerBuilder<ResolvedAddress,
C extends LoadBalancedConnection> - Returns:
- a new instance of
LoadBalancerFactory
with settings from this builder.
-
toString
-