public synchronized void cancel() {
        // Proactively update the status of the connector to UNASSIGNED since this connector
        // instance is being abandoned and we won't update the status on its behalf any more
        // after this since a new instance may be started soon
        statusListener.onShutdown(connName);
        Utils.closeQuietly(ctx, "connector context for " + connName);
        // Preemptively close the offset reader in case the connector is blocked on an offset read.
        Utils.closeQuietly(offsetStorageReader, "offset reader for " + connName);
        cancelled = true;
    }
Stop this connector. This method does not block, it only triggers shutdown. Use
#{@link #awaitShutdown} to block until completion.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java