Class PowerOfTwoReplicaSelector (6.116.0)

public class PowerOfTwoReplicaSelector implements ReplicaSelector

Implementation of ReplicaSelector using the "Power of 2 Random Choices" strategy.

Inheritance

java.lang.Object > PowerOfTwoReplicaSelector

Implements

ReplicaSelector

Constructors

PowerOfTwoReplicaSelector()

public PowerOfTwoReplicaSelector()

Methods

select(List<ChannelEndpoint> candidates, Function<ChannelEndpoint,Double> scoreLookup)

public ChannelEndpoint select(List<ChannelEndpoint> candidates, Function<ChannelEndpoint,Double> scoreLookup)

Selects a replica from the given list of candidates.

Parameters
Name Description
candidates List<ChannelEndpoint>
scoreLookup Function<ChannelEndpoint,Double>
Returns
Type Description
ChannelEndpoint