presto-main/src/main/java/io/prestosql/execution/scheduler/TopologyAwareNodeSelector.java/TopologyAwareNodeSelector/calculateMaxPendingSplits
class TopologyAwareNodeSelector:    private int calculateMaxPendingSplits(int splitAffinity, int totalDepth)
    {
        if (totalDepth == 0) {
            return maxPendingSplitsPerTask;
        }
        // Use half the queue for any split
        // Reserve the other half for splits that have some amount of network affinity
        double queueFraction = 0.5 * (1.0 + splitAffinity / (double) totalDepth);
        return (int) Math.ceil(maxPendingSplitsPerTask * queueFraction);
    }