yurinaryshkin commented on code in PR #11040:
URL: https://github.com/apache/ignite/pull/11040#discussion_r1400064489


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/dump/Dump.java:
##########
@@ -222,32 +224,41 @@ public List<StoredCacheData> configs(String node, int 
group) {
     /**
      * @param node Node directory name.
      * @param group Group id.
+     * @param compressed {@code true} if partition is compressed.
      * @return Dump iterator.
      */
-    public List<Integer> partitions(String node, int group) {
+    public List<Integer> partitions(String node, int group, boolean 
compressed) {
         File[] parts = dumpGroupDirectory(node, group)
-            .listFiles(f -> f.getName().startsWith(PART_FILE_PREFIX) && 
f.getName().endsWith(DUMP_FILE_EXT));
+            .listFiles(f -> f.getName().startsWith(PART_FILE_PREFIX) &&
+                (f.getName().endsWith(compressed ? DUMP_FILE_EXT + ZIP_SUFFIX 
: DUMP_FILE_EXT))
+            );
 
         if (parts == null)
             return Collections.emptyList();
 
         return Arrays.stream(parts)
-            .map(partFile -> 
Integer.parseInt(partFile.getName().replace(PART_FILE_PREFIX, 
"").replace(DUMP_FILE_EXT, "")))
+            .map(partFile -> Integer.parseInt(partFile.getName()
+                .replace(PART_FILE_PREFIX, "")
+                .replace(compressed ? DUMP_FILE_EXT + ZIP_SUFFIX : 
DUMP_FILE_EXT, "")
+            ))
             .collect(Collectors.toList());
     }
 
     /**
      * @param node Node directory name.
      * @param group Group id.
+     * @param compressed {@code true} if the pertition is compressed.
      * @return Dump iterator.
      */
-    public DumpedPartitionIterator iterator(String node, int group, int part) {
-        FileIOFactory ioFactory = new RandomAccessFileIOFactory();
+    public DumpedPartitionIterator iterator(String node, int group, int part, 
boolean compressed) {
+        FileIOFactory ioFactory = compressed ? new UnzipFileIOFactory() : new 
RandomAccessFileIOFactory();
 
         FileIO dumpFile;
 
         try {
-            dumpFile = ioFactory.create(new File(dumpGroupDirectory(node, 
group), PART_FILE_PREFIX + part + DUMP_FILE_EXT));
+            dumpFile = ioFactory.create(new File(dumpGroupDirectory(node, 
group),
+                PART_FILE_PREFIX + part + DUMP_FILE_EXT + (compressed ? 
ZIP_SUFFIX : "")

Review Comment:
   Dump#getDumpPartFileName



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

Reply via email to