sanpwc commented on code in PR #5607:
URL: https://github.com/apache/ignite-3/pull/5607#discussion_r2039738006


##########
modules/distribution-zones/src/integrationTest/java/org/apache/ignite/internal/table/ItEstimatedSizeTest.java:
##########
@@ -178,23 +183,36 @@ private void waitForRebalance(int numNodes) throws 
InterruptedException {
         }
     }
 
-    private Set<String> stableAssignmentNodes() {
+    private Set<String> stableAssignmentNodes(int zoneId) {
         MetaStorageManager metaStorageManager = 
unwrapIgniteImpl(cluster.aliveNode()).metaStorageManager();
 
         var stableAssignmentsPrefix = enabledColocation()
                 ? new 
ByteArray(ZoneRebalanceUtil.STABLE_ASSIGNMENTS_PREFIX_BYTES)
                 : new ByteArray(STABLE_ASSIGNMENTS_PREFIX_BYTES);
 
+
         CompletableFuture<List<Entry>> entriesFuture = 
subscribeToList(metaStorageManager.prefix(stableAssignmentsPrefix));
 
         assertThat(entriesFuture, willCompleteSuccessfully());
 
-        return entriesFuture.join().stream()
-                .map(entry -> Assignments.fromBytes(entry.value()))
-                .filter(Objects::nonNull)
-                .flatMap(assignments -> assignments.nodes().stream())
-                .map(Assignment::consistentId)
-                .collect(toSet());
+        if (enabledColocation()) {
+            return entriesFuture.join().stream()
+                    .filter(entry ->
+                            
ZoneRebalanceUtil.extractZonePartitionId(entry.key(), 
ZoneRebalanceUtil.STABLE_ASSIGNMENTS_PREFIX_BYTES)

Review Comment:
   I don't think that it's a good idea, the fact that it's 
<prefix>.<zoneId>_part_<partId>... is managed in single place(I hope)
   ```
       public static ZonePartitionId fromString(String str) {
           String[] parts = DELIMITER_PATTERN.split(str);
   
           return new ZonePartitionId(Integer.parseInt(parts[0]), 
Integer.parseInt(parts[1]));
       }
   ```
   
   I don't want to spread that information to any other places.



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