presto-main/src/main/java/io/prestosql/execution/StageStateMachine.java/StageStateMachine/transitionToScheduling
class StageStateMachine:    public synchronized boolean transitionToScheduling()
    {
        return stageState.compareAndSet(PLANNED, SCHEDULING);
    }