presto-main/src/main/java/io/prestosql/execution/scheduler/UniformNodeSelector.java/UniformNodeSelector/redistributeSplit
class UniformNodeSelector:    @VisibleForTesting
    public static void redistributeSplit(Multimap<InternalNode, Split> assignment, InternalNode fromNode, InternalNode toNode, SetMultimap<InetAddress, InternalNode> nodesByHost)
    {
        Iterator<Split> splitIterator = assignment.get(fromNode).iterator();
        Split splitToBeRedistributed = null;
        while (splitIterator.hasNext()) {
            Split split = splitIterator.next();
            // Try to select non-local split for redistribution
            if (!split.getAddresses().isEmpty() && !isSplitLocal(split.getAddresses(), fromNode.getHostAndPort(), nodesByHost)) {
                splitToBeRedistributed = split;
                break;
            }
        }
        // Select any split if maxNode has no non-local splits in the current batch of assignment
        if (splitToBeRedistributed == null) {
            splitIterator = assignment.get(fromNode).iterator();
            splitToBeRedistributed = splitIterator.next();
        }
        splitIterator.remove();
        assignment.put(toNode, splitToBeRedistributed);
    }