public void transitionToPlanned() {
    queryState.setIf(PLANNED, currentState -> 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