KAFKA-8974: trim whitespaces in topic#7442
Merged
rhauch merged 3 commits intoapache:trunkfrom Oct 4, 2019
Merged
Conversation
wicknicks
reviewed
Oct 4, 2019
|
|
||
| if (SinkConnectorConfig.hasTopicsConfig(taskConfig)) { | ||
| String[] topics = taskConfig.get(SinkTask.TOPICS_CONFIG).split(","); | ||
| Arrays.parallelSetAll(topics, i->topics[i].trim()); |
Contributor
There was a problem hiding this comment.
do we really need to process this in parallel? seems like setAll() should be simple and clean enough.
Contributor
Author
There was a problem hiding this comment.
yeah, that's a good point. I have modified the code per your suggestion.
rhauch
approved these changes
Oct 4, 2019
Contributor
rhauch
left a comment
There was a problem hiding this comment.
Thanks, @mageshn. LGTM.
Valid characters for Kafka topics are the ASCII alphanumerics, '.', '_', and '-', so trimming the topic names before assignment makes sense.
rhauch
reviewed
Oct 4, 2019
…/WorkerSinkTask.java Co-Authored-By: Randall Hauch <rhauch@gmail.com>
rhauch
pushed a commit
that referenced
this pull request
Oct 4, 2019
…#7442) Trim whitespaces in topic names specified in sink connector configs before subscribing to the consumer. Topic names don't allow whitespace characters, so trimming only will eliminate potential problems and will not place additional limits on topics specified in sink connectors. Author: Magesh Nandakumar <magesh.n.kumar@gmail.com> Reviewers: Arjun Satish <arjun@confluent.io>, Randall Hauch <rhauch@gmail.com>
rhauch
pushed a commit
that referenced
this pull request
Oct 4, 2019
…#7442) Trim whitespaces in topic names specified in sink connector configs before subscribing to the consumer. Topic names don't allow whitespace characters, so trimming only will eliminate potential problems and will not place additional limits on topics specified in sink connectors. Author: Magesh Nandakumar <magesh.n.kumar@gmail.com> Reviewers: Arjun Satish <arjun@confluent.io>, Randall Hauch <rhauch@gmail.com>
rhauch
pushed a commit
that referenced
this pull request
Oct 4, 2019
…#7442) Trim whitespaces in topic names specified in sink connector configs before subscribing to the consumer. Topic names don't allow whitespace characters, so trimming only will eliminate potential problems and will not place additional limits on topics specified in sink connectors. Author: Magesh Nandakumar <magesh.n.kumar@gmail.com> Reviewers: Arjun Satish <arjun@confluent.io>, Randall Hauch <rhauch@gmail.com>
rhauch
pushed a commit
that referenced
this pull request
Oct 4, 2019
…#7442) Trim whitespaces in topic names specified in sink connector configs before subscribing to the consumer. Topic names don't allow whitespace characters, so trimming only will eliminate potential problems and will not place additional limits on topics specified in sink connectors. Author: Magesh Nandakumar <magesh.n.kumar@gmail.com> Reviewers: Arjun Satish <arjun@confluent.io>, Randall Hauch <rhauch@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a minor change that will improve the UX when the topic list includes whitespace in the
topicsconfig for a SinkConnectorCommitter Checklist (excluded from commit message)