Closed futurely closed 9 years ago
RandomWeightedLoadBalancer selects the client using Collections.binarySearch which requires the list to be sorted to avoid undefined results. There are no preconditions to check that the weights are actually sorted.
The list is assumed to be sorted. I'll add documentation to call that out but I don't see the value of doing an actual precondition check.
RandomWeightedLoadBalancer selects the client using Collections.binarySearch which requires the list to be sorted to avoid undefined results. There are no preconditions to check that the weights are actually sorted.