@Override
        public void onConnectorTargetStateChange(String connector) {
            synchronized (StandaloneHerder.this) {
                configState = configBackingStore.snapshot();
                TargetState targetState = configState.targetState(connector);
                worker.setTargetState(connector, targetState, (error, newState) -> {
                    if (error != null) {
                        log.error("Failed to transition connector {} to target state {}", connector, targetState, error);
                        return;
                    }

                    if (newState == TargetState.STARTED) {
                        requestExecutorService.submit(() -> updateConnectorTasks(connector));
                    }
                });
            }
        }
This method performs a few checks for external requests to modify (alter or reset) connector offsets and
completes the callback exceptionally if any check fails.
@param connName the name of the connector whose offsets are to be modified
@param cb callback to invoke upon completion
@return true if all the checks passed, false otherwise
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/standalone/StandaloneHerder.java