ivanzlenko commented on code in PR #5592:
URL: https://github.com/apache/ignite-3/pull/5592#discussion_r2043763090


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -1392,26 +1396,27 @@ private CompletableFuture<Set<Assignment>> 
calculateAssignments(
             TablePartitionId tablePartitionId,
             Long assignmentsTimestamp
     ) {
-        return 
orStopManagerFuture(waitForMetadataCompleteness(assignmentsTimestamp).thenCompose(unused
 -> {
-            int catalogVersion = 
catalogService.activeCatalogVersion(assignmentsTimestamp);
-
-            CatalogTableDescriptor tableDescriptor = 
getTableDescriptor(tablePartitionId.tableId(), catalogVersion);
-
-            CatalogZoneDescriptor zoneDescriptor = 
getZoneDescriptor(tableDescriptor, catalogVersion);
+        CompletableFuture<Set<Assignment>> assignmentsFuture =
+                
reliableCatalogVersions.safeReliableCatalogFor(hybridTimestamp(assignmentsTimestamp))
+                        .thenCompose(catalog -> {
+                            CatalogTableDescriptor tableDescriptor = 
getTableDescriptor(tablePartitionId.tableId(), catalog);
+                            CatalogZoneDescriptor zoneDescriptor = 
getZoneDescriptor(tableDescriptor, catalog);
+
+                            return distributionZoneManager.dataNodes(
+                                    zoneDescriptor.updateTimestamp(),
+                                    catalog.version(),
+                                    tableDescriptor.zoneId()
+                            ).thenApply(dataNodes ->

Review Comment:
   It is not about re-using a method - it is about reducing clutter introduced 
by lambdas. If you have 3 lines or more in lambda it is better to move code 
into a separate method



-- 
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