Class P2CLoadBalancingPolicy<ResolvedAddress,C extends LoadBalancedConnection>

java.lang.Object
io.servicetalk.loadbalancer.LoadBalancingPolicy<ResolvedAddress,C>
io.servicetalk.loadbalancer.P2CLoadBalancingPolicy<ResolvedAddress,C>
Type Parameters:
ResolvedAddress - the type of the resolved address.
C - the type of the load balanced connection.

public final class P2CLoadBalancingPolicy<ResolvedAddress,C extends LoadBalancedConnection> extends LoadBalancingPolicy<ResolvedAddress,C>
A random selection "power of two choices" load balancing policy.

This LoadBalancer selection algorithm is based on work by Michael David Mitzenmacher in The Power of Two Choices in Randomized Load Balancing.

This load balancing policy is characterized by the algorithm: - select two hosts randomly: hosta, and hostb. - if neither host is healthy, repeat selection process until max-effort. - pick the 'best' host of the two options.

See Also: