sk0x50 commented on code in PR #5276: URL: https://github.com/apache/ignite-3/pull/5276#discussion_r1981166689
########## modules/catalog/src/main/java/org/apache/ignite/internal/catalog/Catalog.java: ########## @@ -327,4 +339,24 @@ private static Int2ObjectMap<List<CatalogIndexDescriptor>> toIndexesByTableId(Co return indexesByTableId; } + + private static Int2ObjectMap<List<CatalogTableDescriptor>> toTablesByZoneId(Collection<CatalogSchemaDescriptor> schemas) { + Int2ObjectMap<List<CatalogTableDescriptor>> tablesByZoneId = new Int2ObjectOpenHashMap<>(); + + for (CatalogSchemaDescriptor schema : schemas) { + for (CatalogTableDescriptor table : schema.tables()) { + tablesByZoneId.computeIfAbsent(table.zoneId(), tables -> new ArrayList<>()).add(table); + } + } + + for (List<CatalogTableDescriptor> tables : tablesByZoneId.values()) { + tables.sort(comparingInt(CatalogTableDescriptor::id)); + } + + for (Entry<List<CatalogTableDescriptor>> entry : tablesByZoneId.int2ObjectEntrySet()) { + entry.setValue(unmodifiableList(entry.getValue())); Review Comment: I didn't get your proposal. Could you please elaborate on this? -- 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