Package io.servicetalk.loadbalancer
Class P2CLoadBalancingPolicy.Builder
java.lang.Object
io.servicetalk.loadbalancer.P2CLoadBalancingPolicy.Builder
- Enclosing class:
- P2CLoadBalancingPolicy<ResolvedAddress,
C extends LoadBalancedConnection>
A builder for immutable
P2CLoadBalancingPolicy
instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<ResolvedAddress,
C extends LoadBalancedConnection>
P2CLoadBalancingPolicy<ResolvedAddress,C> build()
Construct an immutableP2CLoadBalancingPolicy
.failOpen
(boolean failOpen) Set whether the host selector should attempt to use an unhealthyHost
as a last resort.maxEffort
(int maxEffort) Set the maximum number of attempts that P2C will attempt to select a pair with at least one healthy host.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
maxEffort
Set the maximum number of attempts that P2C will attempt to select a pair with at least one healthy host.- Parameters:
maxEffort
- the maximum number of attempts.- Returns:
- this
P2CLoadBalancingPolicy.Builder
.
-
failOpen
Set whether the host selector should attempt to use an unhealthyHost
as a last resort.- Parameters:
failOpen
- whether the host selector should attempt to use an unhealthyHost
as a last resort.- Returns:
- this
P2CLoadBalancingPolicy.Builder
.
-
build
public <ResolvedAddress,C extends LoadBalancedConnection> P2CLoadBalancingPolicy<ResolvedAddress,C> build()Construct an immutableP2CLoadBalancingPolicy
.- Type Parameters:
ResolvedAddress
- the type of the resolved address.C
- the refined type of theLoadBalancedConnection
.- Returns:
- the concrete
P2CLoadBalancingPolicy
.
-