You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "shishkovilja (via GitHub)" <gi...@apache.org> on 2023/05/26 13:13:30 UTC

[GitHub] [ignite] shishkovilja commented on a diff in pull request #10638: IGNITE-19164 Improve message about requested partitions during snapshot restore

shishkovilja commented on code in PR #10638:
URL: https://github.com/apache/ignite/pull/10638#discussion_r1206762324


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java:
##########
@@ -1842,10 +1846,18 @@ private static void completeListExceptionally(List<PartitionRestoreFuture> col,
      * @param map Map of partitions and cache groups.
      * @return String representation.
      */
-    private static String partitionsMapToString(Map<Integer, Set<Integer>> map) {
+    private String partitionsMapToString(Map<Integer, Set<Integer>> map) {
+        Map<Integer, String> cacheGrpNames = new HashMap<>(opCtx.dirs.size());
+
+        opCtx.dirs.forEach(dir -> {
+            String grpName = cacheGroupName(dir);
+            cacheGrpNames.put(GridCacheUtils.cacheId(grpName), grpName);
+        });
+
         return map.entrySet()
             .stream()
-            .collect(Collectors.toMap(Map.Entry::getKey, e -> S.toStringSortedDistinct(e.getValue())))
+            .collect(Collectors.toMap(e -> String.format("[grpId=%d, grpName=%s]", e.getKey(), cacheGrpNames.get(e.getKey())),
+                e -> GridToStringBuilder.toStringSortedDistinct(e.getValue())))

Review Comment:
   Is it necessary to revert from `S`?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/SnapshotRestoreProcess.java:
##########
@@ -1842,10 +1846,18 @@ private static void completeListExceptionally(List<PartitionRestoreFuture> col,
      * @param map Map of partitions and cache groups.
      * @return String representation.
      */
-    private static String partitionsMapToString(Map<Integer, Set<Integer>> map) {
+    private String partitionsMapToString(Map<Integer, Set<Integer>> map) {
+        Map<Integer, String> cacheGrpNames = new HashMap<>(opCtx.dirs.size());
+
+        opCtx.dirs.forEach(dir -> {
+            String grpName = cacheGroupName(dir);
+            cacheGrpNames.put(GridCacheUtils.cacheId(grpName), grpName);

Review Comment:
   Is it necessary to rename from `CU`?



-- 
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-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org