Package io.servicetalk.loadbalancer
Class LoadBalancingPolicies
java.lang.Object
io.servicetalk.loadbalancer.LoadBalancingPolicies
A factory to create different
LoadBalancingPolicy
variants.-
Method Summary
Modifier and TypeMethodDescriptionp2c()
Builder for the power of two choices (P2C)LoadBalancingPolicy
.Builder for the round-robinLoadBalancingPolicy
.
-
Method Details
-
roundRobin
Builder for the round-robinLoadBalancingPolicy
.Round-robin load balancing is a strategy that maximizes fairness of the request distribution. This comes at the cost of being unable to bias toward better performing hosts and can only leverage the course grained healthy/unhealthy status of a host.
- Returns:
- a builder for the round-robin
LoadBalancingPolicy
.
-
p2c
Builder for the power of two choices (P2C)LoadBalancingPolicy
.Power of Two Choices (P2C) leverages both course grained healthy/unhealthy status of a host plus additional fine-grained scoring to prioritize hosts that are both healthy and better performing. See the
P2CLoadBalancingPolicy
for more details.- Returns:
- a builder for the power of two choices (P2C)
LoadBalancingPolicy
.
-