You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "lowka (via GitHub)" <gi...@apache.org> on 2025/07/16 09:19:36 UTC
[PR] IGNITE-25572 v2 draft [ignite-3]
lowka opened a new pull request, #6257:
URL: https://github.com/apache/ignite-3/pull/6257
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
### The Review Checklist
- [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:
\- There is a single JIRA ticket related to the pull request.
\- The web-link to the pull request is attached to the JIRA ticket.
\- The JIRA ticket has the Patch Available state.
\- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
\- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
- [ ] **Design:** new code conforms with the design principles of the components it is added to.
- [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
- [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
- [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
### Notes
- [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25572 v2 draft [ignite-3]
Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka commented on code in PR #6257:
URL: https://github.com/apache/ignite-3/pull/6257#discussion_r2209915120
##########
modules/runner/src/test/java/org/apache/ignite/internal/configuration/compatibility/framework/Comp2.java:
##########
@@ -0,0 +1,447 @@
+package org.apache.ignite.internal.configuration.compatibility.framework;
+
+import static org.apache.ignite.internal.lang.IgniteStringFormatter.format;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.stream.Collectors;
+import org.apache.ignite.internal.configuration.compatibility.GenerateConfigurationSnapshot;
+import org.apache.ignite.internal.configuration.compatibility.framework.ConfigNode.NodeReference;
+import org.apache.ignite.internal.configuration.compatibility.framework.ConfigurationTreeComparator.ComparisonContext;
+import org.apache.ignite.internal.logger.IgniteLogger;
+import org.apache.ignite.internal.logger.Loggers;
+import org.apache.ignite.internal.util.CollectionUtils;
+
+public class Comp2 {
+
+ private static final IgniteLogger LOG = Loggers.forClass(GenerateConfigurationSnapshot.class);
+
+ private final ComparisonContext comparisonContext;
+
+ public Comp2() {
+ this.comparisonContext = new ComparisonContext();
+ }
+
+ public Comp2(ComparisonContext comparisonContext) {
+ this.comparisonContext = comparisonContext;
+ }
+
+ public void ensureCompatible(List<ConfigNode> previousRoots, List<ConfigNode> currentRoots) {
+ Map<String, Map<String, ConfigNode>> previousRootsByKind = groupByKind(previousRoots);
+ Map<String, Map<String, ConfigNode>> currentRootsByKind = groupByKind(currentRoots);
+
+ // Compare configuration kinds
+ if (!previousRootsByKind.keySet().equals(currentRootsByKind.keySet())) {
+ String error = format("Configuration kind do not match. Expected: {} but got {}",
+ previousRootsByKind.keySet(),
+ currentRootsByKind.keySet()
+ );
+
+ throw new IllegalStateException(error);
+ }
+
+ // Then compare roots one by one
+ for (Entry<String, Map<String, ConfigNode>> entry : previousRootsByKind.entrySet()) {
+ Map<String, ConfigNode> prev = entry.getValue();
+ Map<String, ConfigNode> current = currentRootsByKind.get(entry.getKey());
+
+ compareConfigRoots(prev, current);
+ }
+ }
+
+ private void compareConfigRoots(Map<String, ConfigNode> previousRoots, Map<String, ConfigNode> currentRoots) {
+ Set<String> removed = CollectionUtils.difference(previousRoots.keySet(), currentRoots.keySet());
+
+ // Check config roots
+ if (!removed.isEmpty()) {
+ String error = format("Incompatible change. Some of the root keys has been removed.\n"
+ + "Removed root keys: {}\n"
+ + "Previous root keys: {}\n"
+ + "Current root keys: {}\n",
+ removed, previousRoots.keySet(), currentRoots.keySet());
+
+ throw new IllegalStateException(error);
+ }
+
+ for (Map.Entry<String, ConfigNode> e : previousRoots.entrySet()) {
+ ConfigNode current = currentRoots.get(e.getKey());
+ if (current == null) {
Review Comment:
I should check new roots like:
```
List<String> errors = new ArrayList<>();
for (String key : CollectionUtils.diff(currentRoots, prevousRoot)) {
ConfigNode current = currentRoots.get(key);
Map<String, List<Path>> paths = buildPaths(current);
validateAdded(paths, paths.keySet(), errors);
}
reportErrors(errors);
```
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-25572 v2 draft [ignite-3]
Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka closed pull request #6257: IGNITE-25572 v2 draft
URL: https://github.com/apache/ignite-3/pull/6257
--
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: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org