Skip to content

[IGNITE-23326] Configuration parser allows duplicated keys#5166

Merged
rpuch merged 9 commits intoapache:mainfrom
gridgain:ignite-23326
Feb 6, 2025
Merged

[IGNITE-23326] Configuration parser allows duplicated keys#5166
rpuch merged 9 commits intoapache:mainfrom
gridgain:ignite-23326

Conversation

@Phillippko
Copy link
Copy Markdown
Contributor

void close();

/** Validate that there are no duplicates in the stored configuration. */
default Collection<ValidationIssue> validateDuplicates() {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this, maybe we should validate duplicates in in LocalFileConfigurationStorage.readDataOnRecovery. But then user won't receive other validation issues until duplicated keys are removed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validation method doesn't seem to belong to a 'storage' abstraction. I suggest moving it elsewhere

@Phillippko Phillippko marked this pull request as ready for review February 4, 2025 11:29
void close();

/** Validate that there are no duplicates in the stored configuration. */
default Collection<ValidationIssue> validateDuplicates() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validation method doesn't seem to belong to a 'storage' abstraction. I suggest moving it elsewhere

public ConfigurationValidationException(Collection<ValidationIssue> issues) {
super(createMessageFromIssues(issues));

this.issues = issues;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make a defensive copy, by the way

}

private static String path(Object firstChild) {
/** Return full path to the given node. Elements of array don't have a NodePath child, so index is used instead. */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/** Return full path to the given node. Elements of array don't have a NodePath child, so index is used instead. */
/** Returns full path to the given node. Elements of array don't have a NodePath child, so index is used instead. */

@rpuch rpuch merged commit d4dc590 into apache:main Feb 6, 2025
@rpuch rpuch deleted the ignite-23326 branch February 6, 2025 11:54
zstan pushed a commit to gridgain/apache-ignite-3 that referenced this pull request Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants