AMashenkov commented on code in PR #6213:
URL: https://github.com/apache/ignite-3/pull/6213#discussion_r2194706987


##########
modules/runner/src/test/java/org/apache/ignite/internal/configuration/compatibility/framework/ConfigurationTreeComparator.java:
##########
@@ -105,6 +114,22 @@ private ConfigNode find(ConfigNode node, 
Collection<ConfigNode> candidates) {
                 }
             }
 
+            if (deletedItems == null) {
+                deletedItems = new ArrayList<>(configModules.size());
+
+                for (ConfigurationModule module : configModules) {
+                    KeyIgnorer keyIgnorer = 
KeyIgnorer.fromDeletedPrefixes(module.deletedPrefixes());
+
+                    deletedItems.add(keyIgnorer);
+                }
+            }
+
+            boolean deleted = deletedItems.stream().anyMatch(i -> 
i.shouldIgnore(node.path()));

Review Comment:
   Should we check deleted prefixes before trying to find a match?
   I'd prefer to avoid using `ConfigurationModule` classes in comparator. Can 
we incapsulate prefixes and maybe the logic into ComparisonContext? 
   
   `LeafNodesVisitor shuttle = new LeafNodesVisitor(new Validator(actualTrees, 
context));`
   ```
   class Validator {
   .....
   private Validator(List<ConfigNode> roots, ComparisonContest context) {
   ....
   private ConfigNode find(ConfigNode node, Collection<ConfigNode> candidates) {
      if (context.isDeleted(node)) {
          return ConfigurationTreeComparator.DELETED_INSTANCE; /// or null ?
      }
      
      for (ConfigNode candidate : candidates) {
                   if (match(node, candidate)) {
                   .......
   ```



-- 
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-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to