presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/metadata/BucketReassigner.java/BucketReassigner/randomTwoChoices
class BucketReassigner:    private String randomTwoChoices()
    {
        // Purely random choices can overload unlucky node while selecting the least loaded one based on stale
        // local information can overload the previous idle node. Here we randomly pick 2 nodes and select the
        // less loaded one. This prevents those issues and renders good enough load balance.
        int randomPosition = ThreadLocalRandom.current().nextInt(activeNodes.size());
        int randomOffset = ThreadLocalRandom.current().nextInt(1, activeNodes.size());
        String candidate1 = activeNodes.get(randomPosition);
        String candidate2 = activeNodes.get((randomPosition + randomOffset) % activeNodes.size());

        return (nodeBucketCounts.get(candidate1) <= nodeBucketCounts.get(candidate2)) ? candidate1 : candidate2;
    }