sanpwc commented on code in PR #2605:
URL: https://github.com/apache/ignite-3/pull/2605#discussion_r1349329166
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -1455,17 +1448,19 @@ private void dropTableLocally(long causalityToken,
CatalogTableDescriptor tableD
}
}
- private Set<Assignment> calculateAssignments(TablePartitionId
tablePartitionId) {
+ private CompletableFuture<Set<Assignment>>
calculateAssignments(TablePartitionId tablePartitionId) {
int catalogVersion = catalogService.latestCatalogVersion();
CatalogTableDescriptor tableDescriptor =
getTableDescriptor(tablePartitionId.tableId(), catalogVersion);
- return AffinityUtils.calculateAssignmentForPartition(
- // TODO: https://issues.apache.org/jira/browse/IGNITE-19425 we
must use distribution zone keys here
-
baselineMgr.nodes().stream().map(ClusterNode::name).collect(toList()),
- tablePartitionId.partitionId(),
- getZoneDescriptor(tableDescriptor, catalogVersion).replicas()
- );
+ CatalogZoneDescriptor zoneDescriptor =
getZoneDescriptor(tableDescriptor, catalogVersion);
+
+ return distributionZoneManager.dataNodes(zoneDescriptor.updateToken(),
tableDescriptor.zoneId()).thenApply(dataNodes ->
+ AffinityUtils.calculateAssignmentForPartition(
+ dataNodes,
+ tablePartitionId.partitionId(),
+ getZoneDescriptor(tableDescriptor,
catalogVersion).replicas()
Review Comment:
Seems that we already have zoneDesciptor variable, right?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]