sashapolo commented on code in PR #5581:
URL: https://github.com/apache/ignite-3/pull/5581#discussion_r2031390948


##########
modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFiltersTest.java:
##########
@@ -138,11 +142,15 @@ void 
testFilteredDataNodesPropagatedToStable(ConsistencyMode consistencyMode) th
 
         TableViewInternal table = (TableViewInternal) 
tableManager.table(TABLE_NAME);
 
-        TablePartitionId partId = new TablePartitionId(table.tableId(), 0);
+        PartitionGroupId partId = enabledColocation()

Review Comment:
   Can we extract this into a method?



##########
modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/table/ItEstimatedSizeTest.java:
##########
@@ -179,7 +181,10 @@ private void waitForRebalance(int numNodes) throws 
InterruptedException {
     private Set<String> stableAssignmentNodes() {
         MetaStorageManager metaStorageManager = 
unwrapIgniteImpl(cluster.aliveNode()).metaStorageManager();
 
-        var stableAssignmentsPrefix = new ByteArray(STABLE_ASSIGNMENTS_PREFIX);
+        // The prefix for stable assignments in the metastorage.

Review Comment:
   Why is this comment needed?



##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/rebalance/ZoneRebalanceUtil.java:
##########
@@ -608,6 +608,24 @@ public static List<Assignments> zoneAssignmentsGetLocally(
                 .collect(toList());
     }
 
+    /**
+     * Returns partition assignments from meta storage.
+     *
+     * @param metaStorageManager Meta storage manager.
+     * @param zoneId Table ID.
+     * @param partitionId Partition ID.
+     * @return Future with partition assignments as a value.
+     */
+    public static CompletableFuture<Set<Assignment>> 
stablePartitionAssignments(

Review Comment:
   There's a `zonePartitionAssignmentsGetLocally` method which does a similar 
thing. Let's call this method `zonePartitionAssignments`



##########
modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/rebalance/ItRebalanceDistributedTest.java:
##########
@@ -1062,45 +1086,96 @@ private Node getLeaseholderNodeForPartition(Node node, 
int partId) {
                 .get();
     }
 
-    private static Set<Assignment> getPartitionClusterNodes(Node node, int 
partNum) {
-        return getPartitionClusterNodes(node, TABLE_NAME, partNum);
+    private static Set<Assignment> getPartitionStableAssignments(Node node, 
int partNum) {
+        return getPartitionStableAssignments(node, TABLE_NAME, partNum);
     }
 
-    private static Set<Assignment> getPartitionClusterNodes(Node node, String 
tableName, int partNum) {
-        return Optional.ofNullable(getTableId(node, tableName))
-                .map(tableId -> 
stablePartitionAssignments(node.metaStorageManager, tableId, partNum).join())
+    private static Set<Assignment> getPartitionStableAssignments(Node node, 
String tableName, int partNum) {
+        int zoneId = getZoneIdByTableNameStrict(node.catalogManager, 
tableName, node.hybridClock.nowLong());

Review Comment:
   This pattern is copied many times, can we extract this somehow?



##########
modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/distributionzones/ItDistributionZonesFiltersTest.java:
##########
@@ -138,11 +142,15 @@ void 
testFilteredDataNodesPropagatedToStable(ConsistencyMode consistencyMode) th
 
         TableViewInternal table = (TableViewInternal) 
tableManager.table(TABLE_NAME);
 
-        TablePartitionId partId = new TablePartitionId(table.tableId(), 0);
+        PartitionGroupId partId = enabledColocation()
+                ? new ZonePartitionId(table.zoneId(), 0)
+                : new TablePartitionId(table.tableId(), 0);
 
         assertValueInStorage(
                 metaStorageManager,
-                stablePartAssignmentsKey(partId),
+                enabledColocation()

Review Comment:
   And 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

Reply via email to