Interface ReplicaSelector

All Known Implementing Classes:
PowerOfTwoReplicaSelector

@InternalApi @BetaApi public interface ReplicaSelector
Interface for selecting a replica from a list of candidates.
  • Method Details

    • select

      ChannelEndpoint select(List<ChannelEndpoint> candidates, Function<ChannelEndpoint,Double> scoreLookup)
      Selects a replica from the given list of candidates.
      Parameters:
      candidates - the list of eligible candidates.
      scoreLookup - a function to look up the latency score for a candidate.
      Returns:
      the selected candidate, or null if the list is empty.