presto-main/src/main/java/io/prestosql/execution/scheduler/AllAtOnceExecutionSchedule.java/AllAtOnceExecutionSchedule/AllAtOnceExecutionSchedule
class AllAtOnceExecutionSchedule:    public AllAtOnceExecutionSchedule(Collection<SqlStageExecution> stages)
    {
        requireNonNull(stages, "stages is null");
        List<PlanFragmentId> preferredScheduleOrder = getPreferredScheduleOrder(stages.stream()
                .map(SqlStageExecution::getFragment)
                .collect(toImmutableList()));

        Ordering<SqlStageExecution> ordering = Ordering.explicit(preferredScheduleOrder)
                .onResultOf(PlanFragment::getId)
                .onResultOf(SqlStageExecution::getFragment);
        schedulingStages = new LinkedHashSet<>(ordering.sortedCopy(stages));
    }