public void transitionTo(TargetState state) {
        synchronized (this) {
            // Ignore the state change if we are stopping.
            // This has the consequence that, if we ever transition to the STOPPED target state (which
            // should never happen since whole point of that state is that it comes with a complete
            // shutdown of all the tasks for the connector), we will never be able to transition out of it.
            // Since part of transitioning to the STOPPED state is that we shut down the task and all of
            // its resources (Kafka clients, SMTs, etc.), this is a reasonable way to do things; otherwise,
            // we'd have to re-instantiate all of those resources to be able to resume (or even just pause)
            // the task .
            if (isStopping()) {
                log.debug("{} Ignoring request to transition stopped task {} to state {}", this, id, state);
                return;
            }

            if (targetState == TargetState.STOPPED)
                log.warn("{} Received unexpected request to transition task {} to state {}; will shut down in response", this, id, TargetState.STOPPED);

            this.targetState = state;
            this.notifyAll();
        }
    }
Await task resumption.

@return true if the task's target state is not paused, false if the task is shutdown before resumption
@throws InterruptedException
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java