Phillippko commented on code in PR #5816: URL: https://github.com/apache/ignite-3/pull/5816#discussion_r2102625956
########## modules/configuration/src/main/java/org/apache/ignite/internal/configuration/util/KeysTrackingConfigurationVisitor.java: ########## @@ -195,32 +202,53 @@ private void endVisit(int previousKeyLength) { currentKey.setLength(previousKeyLength); currentPath.remove(currentPath.size() - 1); - legacyNames.remove(legacyNames.size() - 1); + + String[] legacyNames = currentLegacyNames.remove(currentLegacyNames.size() - 1); + currentLegacyNamesCount -= legacyNames.length; } - /** Calls consumer for all legacy paths. */ - protected void processLegacyPaths(ArrayList<String> path, BiConsumer<String, String> legacyKeyNewKeyConsumer) { - if (path.size() == currentPath().size() - 1) { - for (String legacyName : legacyNames.get(currentPath().size() - 1)) { - String legacyKey = join(appendKey(path, legacyName)); - String newKey = currentKey(); + /** Calls consumer for all variations of legacy paths, i.e. to remove them from the storage. */ + protected void processLegacyPaths(Consumer<String> legacyKeyConsumer) { + // Current path doesn't contain any legacy names. + if (currentLegacyNamesCount == 0) { + return; + } - legacyKeyNewKeyConsumer.accept(legacyKey, newKey); - } + // Contains all combinations of current and old names. + var pathVariations = new ArrayList<List<String>>(currentPath.size()); Review Comment: Introduced this list to simplify code. Removed Created TODO for named lists ########## modules/configuration/src/main/java/org/apache/ignite/internal/configuration/storage/Data.java: ########## @@ -38,17 +38,17 @@ public class Data { * @param changeId Version. */ public Data(Map<String, ? extends Serializable> values, long changeId) { - this.values = values; + this.values = Collections.unmodifiableMap(values); this.changeId = changeId; } /** * Get values. * - * @return Unmodifiable map with data values. + * @return values. Review Comment: REmoved -- 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