private Set<Integer> taskIds(String connector, Map<ConnectorTaskId, Map<String, String>> configs) {
        Set<Integer> tasks = new TreeSet<>();
        if (configs == null) {
            return tasks;
        }
        for (ConnectorTaskId taskId : configs.keySet()) {
            assert taskId.connector().equals(connector);
            tasks.add(taskId.task());
        }
        return tasks;
    }
Given task configurations, get a set of integer task IDs for the connector.
connect/runtime/src/main/java/org/apache/kafka/connect/storage/KafkaConfigBackingStore.java