HDDS-14105. Require ConfigGroup prefix to be present in Config keys #9463
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.
What changes were proposed in this pull request?
After HDDS-12424,
ConfigGroup#prefixcan now be included inConfig#key, which helps when searching by full config property name. Some new keys were added recently with prefix included. HDDS-14030 added the prefix in all existing config keys to ensure consistent style.This change proposes to make the prefix mandatory so that we:
For that, we need to remove support for inheriting configuration keys from ancestor classes. In theory this feature would help reuse, applying different prefixes to different subclasses of the same base one. However, this is currently used only in mock configuration classes, which exist for testing the configuration framework. I think descriptions, tags and maybe even default values would need to be different across subclasses, so it does not seem very practical. We can still inherit some implementation for reuse and apply the
@Configannotation in the subclass.Config keys are validated against the prefix at compile time. Sample error when prefix is missing:
https://issues.apache.org/jira/browse/HDDS-14105
How was this patch tested?
CI:
https://github.com/adoroszlai/ozone/actions/runs/20035584181