MINOR: create KafkaConfigSchema and TimelineObject#11809
Merged
cmccabe merged 3 commits intoapache:trunkfrom Mar 2, 2022
Merged
MINOR: create KafkaConfigSchema and TimelineObject#11809cmccabe merged 3 commits intoapache:trunkfrom
cmccabe merged 3 commits intoapache:trunkfrom
Conversation
Create KafkaConfigSchema to encapsulate the concept of determining the types of configuration keys. This is useful in the controller because we can't import KafkaConfig, which is part of core. Also introduce the TimelineObject class, which is a more generic version of TimelineInteger / TimelineLong.
e680476 to
74faa70
Compare
mumrah
approved these changes
Mar 2, 2022
| import static java.util.Collections.emptyMap; | ||
|
|
||
|
|
||
| public class KafkaConfigSchema { |
Member
There was a problem hiding this comment.
Can we add a brief javadoc explaining the purpose of this class?
Comment on lines
+184
to
+185
| ConfigResource.Type.BROKER -> KafkaConfig.configDef, | ||
| ConfigResource.Type.TOPIC -> LogConfig.configDefCopy, |
Member
There was a problem hiding this comment.
I realize this is just copied over from ControllerServer, but why do we make a copy of the LogConfig but not KafkaConfig here?
Contributor
Author
There was a problem hiding this comment.
In practice nobody mutates either of these. But you're right, it is inconsistent. I will do a defensive copy on the KafkaConfig one.
In the future we should have a freeze method or something on the ConfigDef to make these defensive copies unnecessary. But that's out of scope here...
e1b6b69 to
034344d
Compare
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.
Create KafkaConfigSchema to encapsulate the concept of determining the types of configuration keys. This is useful in the controller because we can't import KafkaConfig, which is part of core. Also introduce the TimelineObject class, which is a more generic version of TimelineInteger / TimelineLong.