Cyrill commented on code in PR #5544:
URL: https://github.com/apache/ignite-3/pull/5544#discussion_r2031166546


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/disaster/DisasterRecoveryManager.java:
##########
@@ -448,6 +452,112 @@ public CompletableFuture<Void> restartPartitions(
         }
     }
 
+    /**
+     * Returns states of partitions in the cluster. Result is a mapping of 
{@link ZonePartitionId} to the mapping
+     * between a node name and a partition state.
+     *
+     * @param zoneNames Names specifying zones to get partition states from. 
Case-sensitive, empty set means "all zones".
+     * @param nodeNames Names specifying nodes to get partition states from. 
Case-sensitive, empty set means "all nodes".
+     * @param partitionIds IDs of partitions to get states of. Empty set means 
"all partitions".
+     * @return Future with the mapping.
+     */
+    public CompletableFuture<Map<ZonePartitionId, 
LocalZonePartitionStateByNode>> localZonePartitionStates(
+            Set<String> zoneNames,
+            Set<String> nodeNames,
+            Set<Integer> partitionIds
+    ) {
+        try {
+            Catalog catalog = catalogLatestVersion();
+
+            return localZonePartitionStatesInternal(zoneNames, nodeNames, 
partitionIds, catalog)
+                    .thenApply(res -> normalizeZoneLocal(res, catalog));
+        } catch (Throwable t) {
+            return failedFuture(t);
+        }
+    }
+
+    /**
+     * Returns states of partitions in the cluster. Result is a mapping of 
{@link ZonePartitionId} to the global
+     * partition state enum value.
+     *
+     * @param zoneNames Names specifying zones to get partition states. 
Case-sensitive, empty set means "all zones".
+     * @param partitionIds IDs of partitions to get states of. Empty set means 
"all partitions".
+     * @return Future with the mapping.
+     */
+    public CompletableFuture<Map<ZonePartitionId, GlobalZonePartitionState>> 
globalZonePartitionStates(
+            Set<String> zoneNames,
+            Set<Integer> partitionIds
+    ) {
+        try {
+            Catalog catalog = catalogLatestVersion();
+
+            return localZonePartitionStatesInternal(zoneNames, Set.of(), 
partitionIds, catalog)
+                    .thenApply(res -> normalizeZoneLocal(res, catalog))
+                    .thenApply(res -> assembleZoneGlobal(res, partitionIds, 
catalog));
+        } catch (Throwable t) {
+            return failedFuture(t);
+        }
+    }
+
+    CompletableFuture<Map<ZonePartitionId, LocalPartitionStateMessageByNode>> 
localZonePartitionStatesInternal(

Review Comment:
   Granted that TablePartitionId will go away soon, is there any sense in 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