anton-vinogradov commented on code in PR #12081:
URL: https://github.com/apache/ignite/pull/12081#discussion_r2114351908


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java:
##########
@@ -549,7 +549,16 @@ private CacheStoreHolder initDir(
         DataRegion dataRegion
     ) throws IgniteCheckedException {
         try {
-            boolean dirExisted = checkAndInitCacheWorkDir(cft);
+            boolean dirExisted = false;

Review Comment:
   Could be relocated close to the usage.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -560,7 +573,7 @@ public List<File> existingTmpCacheStorages() {
      * @return Cache configuration file with respect to {@link 
CacheConfiguration#getGroupName} value.
      */
     public File cacheConfigurationFile(CacheConfiguration<?, ?> ccfg) {
-        return new File(cacheStorage(ccfg), ccfg.getGroupName() == null
+        return new File(cacheStorages(ccfg)[0], ccfg.getGroupName() == null

Review Comment:
   How about to use node storage instead?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/CacheFileTree.java:
##########
@@ -156,7 +157,7 @@ public File defragmentedIndexTmpFile() {
      * @see #defragmentedIndexTmpFile()
      */
     public File defragmentedIndexFile() {
-        return new File(storage(), DFRG_INDEX_FILE_NAME);
+        return new File(partitionRoot(INDEX_PARTITION), DFRG_INDEX_FILE_NAME);

Review Comment:
   Do we have single index file? If no, should we make same spreading for 
indices?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/FileTreeUtils.java:
##########
@@ -100,4 +116,13 @@ private static void createAndCheck(File dir, String desc, 
IgniteLogger log) thro
                 "Current persistence store directory is: [" + 
dir.getAbsolutePath() + "]");
         }
     }
+
+    /**
+     * @param storages Storages to select from.
+     * @param part Partition.
+     * @return Storage for partition.
+     */
+    static <T> T oneOf(T[] storages, int part) {

Review Comment:
   resolveStorage?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java:
##########
@@ -549,7 +549,16 @@ private CacheStoreHolder initDir(
         DataRegion dataRegion
     ) throws IgniteCheckedException {
         try {
-            boolean dirExisted = checkAndInitCacheWorkDir(cft);
+            boolean dirExisted = false;
+
+            for (File storage : cft.storages()) {
+                if (storage.exists()) {
+                    dirExisted = true;
+                    break;

Review Comment:
   Looks, like we're checking only first one, instead of all.
   Also, could be relocated to the checkAndInitCacheWorkDir() ?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java:
##########
@@ -570,7 +583,7 @@ public File cacheConfigurationFile(CacheConfiguration<?, ?> 
ccfg) {
      * @return Cache configuration file with respect to {@link 
CacheConfiguration#getGroupName} value.
      */
     public File tmpCacheConfigurationFile(CacheConfiguration<?, ?> ccfg) {
-        return new File(cacheStorage(ccfg), ccfg.getGroupName() == null
+        return new File(cacheStorages(ccfg)[0], ccfg.getGroupName() == null

Review Comment:
   How about to use node storage instead?



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