private void doTransitionTo(TargetState targetState) {
        log.debug("{} Transition connector to {}", this, targetState);
        if (targetState == TargetState.PAUSED) {
            suspend(true);
        } else if (targetState == TargetState.STOPPED) {
            suspend(false);
        } else if (targetState == TargetState.STARTED) {
            if (state == State.INIT)
                start();
            else
                resume();
        } else {
            throw new IllegalArgumentException("Unhandled target state " + targetState);
        }
    }
Wait for this connector to finish shutting down.

@param timeoutMs time in milliseconds to await shutdown
@return true if successful, false if the timeout was reached
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java