You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ivanyu (via GitHub)" <gi...@apache.org> on 2024/05/02 14:16:51 UTC
Re: [PR] KAFKA-16445: Add PATCH method for connector config [kafka]
ivanyu commented on code in PR #6934:
URL: https://github.com/apache/kafka/pull/6934#discussion_r1587717243
##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/AbstractHerder.java:
##########
@@ -992,4 +992,15 @@ public List<String> setWorkerLoggerLevel(String namespace, String desiredLevelSt
return loggers.setLevel(namespace, level);
}
+ protected Map<String, String> applyConnectorConfigPatch(Map<String, String> currentConfig, Map<String, String> configPatch) {
+ Map<String, String> patchedConfig = new HashMap<>(currentConfig);
+ configPatch.forEach((k, v) -> {
+ if (v != null) {
+ patchedConfig.put(k, v);
+ } else {
+ patchedConfig.remove(k);
+ }
+ });
+ return patchedConfig;
+ }
Review Comment:
I did this, extracted into `ConnectUtils` (because I think the `null` processing logic may be connect-specific) + added a unit test for this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org