private byte[] serializeTargetState(TargetState state) {
        Struct connectTargetState = new Struct(TARGET_STATE_V1);
        // Older workers don't support the STOPPED state; fall back on PAUSED
        connectTargetState.put("state", state == STOPPED ? PAUSED.name() : state.name());
        connectTargetState.put("state.v2", state.name());
        return converter.fromConnectData(topic, TARGET_STATE_V1, connectTargetState);
    }
Write a new {@link TargetState} for the connector. Note that {@link #claimWritePrivileges()} does not need to be
invoked before invoking this method.
@param connector the name of the connector
@param state the desired target state for the connector
connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java