public void transitionToRunning() {
    // if we can skipExecute in QueryExecution.start(), we will directly change from QUEUED to
    // RUNNING
    queryState.setIf(
        RUNNING, currentState -> currentState == DISPATCHING || currentState == QUEUED);
  }
State machine for a {@link QueryExecution}. It stores the states for the {@link QueryExecution}.
Others can register listeners when the state changes of the {@link QueryExecution}.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/QueryStateMachine.java