tkalkirill commented on code in PR #947:
URL: https://github.com/apache/ignite-3/pull/947#discussion_r928626846


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/FilePageStoreManager.java:
##########
@@ -305,14 +340,99 @@ private List<FilePageStore> createFilePageStores(
 
         try {
             for (int i = 0; i < partitions; i++) {
-                Path partFilePath = 
groupWorkDir.resolve(String.format(PART_FILE_TEMPLATE, i));
+                int part = i;
+
+                Path partFilePath = 
groupWorkDir.resolve(String.format(PART_FILE_TEMPLATE, part));
+
+                Path[] partDeltaFiles = findPartitionDeltaFiles(groupWorkDir, 
partitions);
+
+                FilePageStore filePageStore = 
filePageStoreFactory.createPageStore(buffer.rewind(), partFilePath, 
partDeltaFiles);
+
+                filePageStore.setDeltaFilePageStoreIoFactory((index, 
pageIndexes) -> createLatest(groupWorkDir, part, index, pageIndexes));
+
+                
filePageStore.setCompleteCreationDeltaFilePageStoreIoCallback(deltaIo -> 
renameDeltaFile(groupWorkDir, part, deltaIo));
 
-                
partitionFilePageStores.add(filePageStoreFactory.createPageStore(partFilePath, 
buffer.rewind()));
+                partitionFilePageStores.add(filePageStore);
             }
 
             return unmodifiableList(partitionFilePageStores);
         } finally {
             freeBuffer(buffer);
         }
     }
+
+    /**
+     * Returns paths (unsorted) to delta files for the requested partition.
+     *
+     * @param groupWorkDir Group directory.
+     * @param partition Partition number.
+     */
+    Path[] findPartitionDeltaFiles(Path groupWorkDir, int partition) throws 
IgniteInternalCheckedException {
+        assert partition >= 0 : partition;
+
+        try (Stream<Path> deltaFileStream = Files.find(
+                groupWorkDir,
+                1,
+                (path, basicFileAttributes) -> 
path.getFileName().toString().startsWith(String.format(PART_DELTA_FILE_PREFIX, 
partition)))

Review Comment:
   fix it.



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