presto-main/src/main/java/io/prestosql/execution/scheduler/AllAtOnceExecutionSchedule.java/AllAtOnceExecutionSchedule/getStagesToSchedule
class AllAtOnceExecutionSchedule:    @Override
    public Set<SqlStageExecution> getStagesToSchedule()
    {
        for (Iterator<SqlStageExecution> iterator = schedulingStages.iterator(); iterator.hasNext(); ) {
            StageState state = iterator.next().getState();
            if (state == SCHEDULED || state == RUNNING || state.isDone()) {
                iterator.remove();
            }
        }
        return schedulingStages;
    }