public synchronized void doChangeState(State nextState) {
        LOGGER.debug("state change, current state is {}, next state is {}", currentState, nextState);
        Pair<State, State> statePair = new ImmutablePair<>(currentState, nextState);
        StateCallback callback = callBacks.get(statePair);
        // change state before callback.
        State lastState = currentState;
        currentState = nextState;
        if (callback != null) {
            callback.call(lastState, nextState);
        }
    }
change state and execute callback functions

@param nextState next state
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/state/AbstractStateWrapper.java