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
-
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.connectionPoolConfig
(ConnectionPoolConfig connectionPoolConfig) Set theConnectionPoolStrategy
to use with this load balancer.protected final LoadBalancerBuilder<ResolvedAddress,
C> delegate()
Returns theDelegatingLoadBalancerBuilder
delegate.loadBalancerObserver
(LoadBalancerObserver loadBalancerObserver) Set theLoadBalancerObserver
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.
-
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 LoadBalancerObserver loadBalancerObserver) Description copied from interface:LoadBalancerBuilder
Set theLoadBalancerObserver
to use with this load balancer.- Specified by:
loadBalancerObserver
in interfaceLoadBalancerBuilder<ResolvedAddress,
C extends LoadBalancedConnection> - Parameters:
loadBalancerObserver
- theLoadBalancerObserver
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 theLoadBalancingPolicy
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
.
-
connectionPoolConfig
public LoadBalancerBuilder<ResolvedAddress,C> connectionPoolConfig(ConnectionPoolConfig connectionPoolConfig) Description copied from interface:LoadBalancerBuilder
Set theConnectionPoolStrategy
to use with this load balancer.- Specified by:
connectionPoolConfig
in interfaceLoadBalancerBuilder<ResolvedAddress,
C extends LoadBalancedConnection> - Parameters:
connectionPoolConfig
- the factory of connection pooling 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.
-