You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ni...@apache.org on 2025/02/21 19:32:08 UTC

(ignite) branch master updated: IGNITE-24575 Move constant to private (#11891)

This is an automated email from the ASF dual-hosted git repository.

nizhikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 11551641601 IGNITE-24575 Move constant to private (#11891)
11551641601 is described below

commit 11551641601c02849e89056617c6dd8589e371e6
Author: Nikolay <ni...@apache.org>
AuthorDate: Fri Feb 21 22:32:00 2025 +0300

    IGNITE-24575 Move constant to private (#11891)
---
 .../commandline/indexreader/IgniteIndexReader.java | 11 +++++-----
 .../util/GridCommandHandlerIndexingTest.java       |  8 ++++++--
 .../GridCacheDatabaseSharedManager.java            | 10 ++-------
 .../defragmentation/DefragmentationFileUtils.java  |  8 ++++----
 .../persistence/file/FilePageStoreManager.java     |  7 +++----
 .../cache/persistence/filename/NodeFileTree.java   | 24 +++++++++++++++++++---
 .../snapshot/IgniteSnapshotManager.java            |  9 --------
 ...CacheConfigurationFileConsistencyCheckTest.java | 11 ++--------
 .../wal/IgniteNodeStoppedDuringDisableWALTest.java |  5 +++--
 .../IgnitePdsIndexingDefragmentationTest.java      |  7 ++++---
 .../processors/database/RebuildIndexTest.java      | 10 +++++----
 .../RebuildIndexWithHistoricalRebalanceTest.java   | 10 +++++----
 .../WalDisabledDuringIndexRecreateTest.java        |  5 +++--
 .../query/h2/GridIndexRebuildSelfTest.java         |  5 +++--
 14 files changed, 69 insertions(+), 61 deletions(-)

diff --git a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReader.java b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReader.java
index cf8575af030..6340cd80f6a 100644
--- a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReader.java
+++ b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/indexreader/IgniteIndexReader.java
@@ -117,7 +117,7 @@ import static org.apache.ignite.internal.pagemem.PageIdUtils.pageId;
 import static org.apache.ignite.internal.pagemem.PageIdUtils.pageIndex;
 import static org.apache.ignite.internal.pagemem.PageIdUtils.partId;
 import static org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreV2.VERSION;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 import static org.apache.ignite.internal.util.GridUnsafe.allocateBuffer;
 import static org.apache.ignite.internal.util.GridUnsafe.bufferAddress;
 import static org.apache.ignite.internal.util.GridUnsafe.freeBuffer;
@@ -271,9 +271,9 @@ public class IgniteIndexReader implements AutoCloseable {
         idxStore = filePageStore(INDEX_PARTITION, FLAG_IDX, storeFactory);
 
         if (isNull(idxStore))
-            throw new IgniteCheckedException(INDEX_FILE_NAME + " file not found");
+            throw new IgniteCheckedException(partitionFileName(INDEX_PARTITION) + " file not found");
 
-        log.info("Analyzing file: " + INDEX_FILE_NAME);
+        log.info("Analyzing file: " + partitionFileName(INDEX_PARTITION));
 
         partStores = new FilePageStore[partCnt];
 
@@ -304,7 +304,8 @@ public class IgniteIndexReader implements AutoCloseable {
             Collections.emptyList(),
             asList(
                 argument(DIR_ARG, String.class)
-                    .withUsage("partition directory, where " + INDEX_FILE_NAME + " and (optionally) partition files are located.")
+                    .withUsage("partition directory, where " + partitionFileName(INDEX_PARTITION) +
+                        " and (optionally) partition files are located.")
                     .build(),
                 optionalArgument(PART_CNT_ARG, Integer.class).withUsage("full partitions count in cache group.").withDefault(0).build(),
                 optionalArgument(PAGE_SIZE_ARG, Integer.class).withUsage("page size.").withDefault(DFLT_PAGE_SIZE).build(),
@@ -344,7 +345,7 @@ public class IgniteIndexReader implements AutoCloseable {
             reader.readIndex();
         }
         catch (IgniteCheckedException e) {
-            throw new IgniteException(INDEX_FILE_NAME + " scan problem", e);
+            throw new IgniteException(partitionFileName(INDEX_PARTITION) + " scan problem", e);
         }
     }
 
diff --git a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingTest.java b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingTest.java
index d95a37a3cfa..cc7ecd1cb3c 100644
--- a/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingTest.java
+++ b/modules/control-utility/src/test/java/org/apache/ignite/util/GridCommandHandlerIndexingTest.java
@@ -39,7 +39,8 @@ import org.junit.Test;
 
 import static org.apache.ignite.internal.IgniteNodeAttributes.ATTR_IGNITE_INSTANCE_NAME;
 import static org.apache.ignite.internal.commandline.CommandHandler.EXIT_CODE_OK;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
+import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 import static org.apache.ignite.internal.processors.cache.verify.IdleVerifyUtility.GRID_NOT_IDLE_MSG;
 import static org.apache.ignite.testframework.GridTestUtils.assertContains;
 import static org.apache.ignite.testframework.GridTestUtils.assertNotContains;
@@ -342,7 +343,10 @@ public class GridCommandHandlerIndexingTest extends GridCommandHandlerClusterPer
      * Get index partition file for specific node and cache.
      */
     private File indexPartition(Ignite ig, String groupName) {
-        return new File(((IgniteEx)ig).context().pdsFolderResolver().fileTree().cacheStorage(true, groupName), INDEX_FILE_NAME);
+        return new File(
+            ((IgniteEx)ig).context().pdsFolderResolver().fileTree().cacheStorage(true, groupName),
+            partitionFileName(INDEX_PARTITION)
+        );
     }
 
     /**
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
index 35356be370a..646ec36959f 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java
@@ -118,7 +118,6 @@ import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
 import org.apache.ignite.internal.processors.cache.persistence.file.FileIOFactory;
 import org.apache.ignite.internal.processors.cache.persistence.file.FilePageStore;
 import org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager;
-import org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree;
 import org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage;
 import org.apache.ignite.internal.processors.cache.persistence.metastorage.MetastorageLifecycleListener;
 import org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryEx;
@@ -188,6 +187,7 @@ import static org.apache.ignite.internal.processors.cache.persistence.checkpoint
 import static org.apache.ignite.internal.processors.cache.persistence.defragmentation.CachePartitionDefragmentationManager.DEFRAGMENTATION_MNTC_TASK_NAME;
 import static org.apache.ignite.internal.processors.cache.persistence.defragmentation.maintenance.DefragmentationParameters.fromStore;
 import static org.apache.ignite.internal.processors.cache.persistence.file.FilePageStoreManager.CORRUPTED_DATA_FILES_MNTC_TASK_NAME;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 import static org.apache.ignite.internal.util.IgniteUtils.GB;
 import static org.apache.ignite.internal.util.IgniteUtils.checkpointBufferSize;
 
@@ -266,12 +266,6 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
     private final int defragmentationRegionSizePercentageOfConfiguredSize =
         getInteger(IGNITE_DEFRAGMENTATION_REGION_SIZE_PERCENTAGE, DFLT_DEFRAGMENTATION_REGION_SIZE_PERCENTAGE);
 
-    /** */
-    private static final String MBEAN_NAME = "DataStorageMetrics";
-
-    /** */
-    private static final String MBEAN_GROUP = "Persistent Store";
-
     /** WAL marker prefix for meta store. */
     private static final String WAL_KEY_PREFIX = "grp-wal-";
 
@@ -1321,7 +1315,7 @@ public class GridCacheDatabaseSharedManager extends IgniteCacheDatabaseSharedMan
 
                 Path anyIdxPartFile = IgniteUtils.searchFileRecursively(
                     cctx.kernalContext().pdsFolderResolver().fileTree().nodeStorage().toPath(),
-                    NodeFileTree.INDEX_FILE_NAME
+                    partitionFileName(PageIdAllocator.INDEX_PARTITION)
                 );
 
                 if (anyIdxPartFile != null) {
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/defragmentation/DefragmentationFileUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/defragmentation/DefragmentationFileUtils.java
index 1c329cee6f6..100c1b70892 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/defragmentation/DefragmentationFileUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/defragmentation/DefragmentationFileUtils.java
@@ -32,12 +32,12 @@ import static java.nio.file.StandardCopyOption.ATOMIC_MOVE;
 import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
 import static java.nio.file.StandardOpenOption.CREATE_NEW;
 import static java.nio.file.StandardOpenOption.WRITE;
+import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
 import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.FILE_SUFFIX;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
 import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_PREFIX;
 import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.PART_FILE_PREFIX;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.PART_FILE_TEMPLATE;
 import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.TMP_SUFFIX;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 
 /**
  * Everything related to file management during defragmentation process.
@@ -217,7 +217,7 @@ public class DefragmentationFileUtils {
             for (File partFile : workDir.listFiles((dir, name) -> name.startsWith(DFRG_PARTITION_FILE_PREFIX))) {
                 int partId = extractPartId(partFile.getName());
 
-                File oldPartFile = new File(workDir, String.format(PART_FILE_TEMPLATE, partId));
+                File oldPartFile = new File(workDir, partitionFileName(partId));
 
                 Files.move(partFile.toPath(), oldPartFile.toPath(), ATOMIC_MOVE, REPLACE_EXISTING);
             }
@@ -225,7 +225,7 @@ public class DefragmentationFileUtils {
             File idxFile = new File(workDir, DFRG_INDEX_FILE_NAME);
 
             if (idxFile.exists()) {
-                File oldIdxFile = new File(workDir, INDEX_FILE_NAME);
+                File oldIdxFile = new File(workDir, partitionFileName(INDEX_PARTITION));
 
                 Files.move(idxFile.toPath(), oldIdxFile.toPath(), ATOMIC_MOVE, REPLACE_EXISTING);
             }
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java
index f4103787924..461571078fd 100755
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/file/FilePageStoreManager.java
@@ -85,10 +85,9 @@ import static java.nio.file.Files.newDirectoryStream;
 import static java.util.Objects.requireNonNull;
 import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
 import static org.apache.ignite.internal.pagemem.PageIdAllocator.MAX_PARTITION_ID;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.CACHE_DATA_TMP_FILENAME;
 import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.FILE_SUFFIX;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
 import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.TMP_SUFFIX;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 import static org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage.METASTORAGE_DIR_NAME;
 
 /**
@@ -193,7 +192,7 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen
         List<File> files = ft.cacheDirectories(f -> true);
 
         for (File file : files) {
-            File[] tmpFiles = file.listFiles((k, v) -> v.endsWith(CACHE_DATA_TMP_FILENAME));
+            File[] tmpFiles = file.listFiles(NodeFileTree::tmpCacheConfig);
 
             if (tmpFiles != null) {
                 for (File tmpFile : tmpFiles) {
@@ -600,7 +599,7 @@ public class FilePageStoreManager extends GridCacheSharedManagerAdapter implemen
                     DefragmentationFileUtils.beforeInitPageStores(cacheWorkDir, log);
             }
 
-            File idxFile = new File(cacheWorkDir, INDEX_FILE_NAME);
+            File idxFile = new File(cacheWorkDir, partitionFileName(INDEX_PARTITION));
 
             GridQueryProcessor qryProc = cctx.kernalContext().query();
 
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java
index 0157fcd8921..74cf877f9b3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/filename/NodeFileTree.java
@@ -204,16 +204,16 @@ public class NodeFileTree extends SharedFileTree {
     public static final String INDEX_FILE_PREFIX = "index";
 
     /** Index file name. */
-    public static final String INDEX_FILE_NAME = INDEX_FILE_PREFIX + FILE_SUFFIX;
+    protected static final String INDEX_FILE_NAME = INDEX_FILE_PREFIX + FILE_SUFFIX;
 
     /** Partition file template. */
-    public static final String PART_FILE_TEMPLATE = PART_FILE_PREFIX + "%d" + FILE_SUFFIX;
+    protected static final String PART_FILE_TEMPLATE = PART_FILE_PREFIX + "%d" + FILE_SUFFIX;
 
     /** */
     public static final String CACHE_DATA_FILENAME = "cache_data.dat";
 
     /** */
-    public static final String CACHE_DATA_TMP_FILENAME = CACHE_DATA_FILENAME + TMP_SUFFIX;
+    private static final String CACHE_DATA_TMP_FILENAME = CACHE_DATA_FILENAME + TMP_SUFFIX;
 
     /** Temporary cache directory prefix. */
     private static final String TMP_CACHE_DIR_PREFIX = "_tmp_snp_restore_";
@@ -516,6 +516,16 @@ public class NodeFileTree extends SharedFileTree {
             : (ccfg.getName() + CACHE_DATA_FILENAME));
     }
 
+    /**
+     * @param ccfg Cache configuration.
+     * @return Cache configuration file with respect to {@link CacheConfiguration#getGroupName} value.
+     */
+    public File tmpCacheConfigurationFile(CacheConfiguration<?, ?> ccfg) {
+        return new File(cacheStorage(ccfg), ccfg.getGroupName() == null
+            ? (CACHE_DATA_TMP_FILENAME)
+            : (ccfg.getName() + CACHE_DATA_TMP_FILENAME));
+    }
+
     /**
      * @param ccfg Cache configuration.
      * @param part Partition id.
@@ -644,6 +654,14 @@ public class NodeFileTree extends SharedFileTree {
         return f.isDirectory() && f.getName().startsWith(TMP_CACHE_DIR_PREFIX);
     }
 
+    /**
+     * @param f File.
+     * @return {@code True} if file conforms temp cache configuration file name pattern.
+     */
+    public static boolean tmpCacheConfig(File f) {
+        return f.getName().endsWith(CACHE_DATA_TMP_FILENAME);
+    }
+
     /**
      * @param f File.
      * @return {@code True} if file is regular(not temporary).
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
index 016cce1fec0..313e8fbed69 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/snapshot/IgniteSnapshotManager.java
@@ -212,7 +212,6 @@ import static org.apache.ignite.internal.pagemem.PageIdUtils.toDetailString;
 import static org.apache.ignite.internal.processors.cache.GridCacheUtils.baselineNode;
 import static org.apache.ignite.internal.processors.cache.GridCacheUtils.isPersistenceEnabled;
 import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.cacheName;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.PdsFolderResolver.DB_DEFAULT_FOLDER;
 import static org.apache.ignite.internal.processors.cache.persistence.filename.SnapshotFileTree.partDeltaIndexFile;
 import static org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage.METASTORAGE_CACHE_ID;
 import static org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage.METASTORAGE_CACHE_NAME;
@@ -2733,14 +2732,6 @@ public class IgniteSnapshotManager extends GridCacheSharedManagerAdapter
             .orElse(null);
     }
 
-    /**
-     * @return Relative configured path of persistence data storage directory for the local node.
-     * Example: {@code snapshotWorkDir/db/IgniteNodeName0}
-     */
-    static String databaseRelativePath(String folderName) {
-        return Paths.get(DB_DEFAULT_FOLDER, folderName).toString();
-    }
-
     /**
      * @param factory Factory to produce FileIO access.
      * @param from Copy from file.
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheConfigurationFileConsistencyCheckTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheConfigurationFileConsistencyCheckTest.java
index 71b986c698a..7f28d565d3a 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheConfigurationFileConsistencyCheckTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsCacheConfigurationFileConsistencyCheckTest.java
@@ -21,7 +21,6 @@ import java.io.BufferedOutputStream;
 import java.io.DataOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
-import java.io.FilenameFilter;
 import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.List;
@@ -44,8 +43,6 @@ import org.apache.ignite.testframework.GridTestUtils;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.junit.Test;
 
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.CACHE_DATA_TMP_FILENAME;
-
 /**
  * Tests that ignite can start when caches' configurations with same name in different groups stored.
  */
@@ -144,11 +141,7 @@ public class IgnitePdsCacheConfigurationFileConsistencyCheckTest extends GridCom
 
             NodeFileTree ft = ig.context().pdsFolderResolver().fileTree();
 
-            File[] tmpFile = ft.cacheStorage(desc.cacheConfiguration()).listFiles(new FilenameFilter() {
-                @Override public boolean accept(File dir, String name) {
-                    return name.endsWith(CACHE_DATA_TMP_FILENAME);
-                }
-            });
+            File[] tmpFile = ft.cacheStorage(desc.cacheConfiguration()).listFiles(NodeFileTree::tmpCacheConfig);
 
             assertNotNull(tmpFile);
 
@@ -217,7 +210,7 @@ public class IgnitePdsCacheConfigurationFileConsistencyCheckTest extends GridCom
 
             data.config().setGroupName(ODD_GROUP_NAME);
 
-            File tmp = new File(ft.cacheStorage(data.config()), data.config().getName() + CACHE_DATA_TMP_FILENAME);
+            File tmp = ft.tmpCacheConfigurationFile(data.config());
 
             try (OutputStream stream = new BufferedOutputStream(new FileOutputStream(tmp))) {
                 marshaller.marshal(data, stream);
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteNodeStoppedDuringDisableWALTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteNodeStoppedDuringDisableWALTest.java
index 1bcf34207be..a815c89c1e0 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteNodeStoppedDuringDisableWALTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/db/wal/IgniteNodeStoppedDuringDisableWALTest.java
@@ -49,8 +49,9 @@ import org.junit.runners.Parameterized;
 
 import static java.nio.file.FileVisitResult.CONTINUE;
 import static java.nio.file.Files.walkFileTree;
+import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
 import static org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointMarkersStorage.CP_FILE_NAME_PATTERN;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 import static org.apache.ignite.internal.processors.cache.persistence.metastorage.MetaStorage.METASTORAGE_DIR_NAME;
 import static org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager.WAL_NAME_PATTERN;
 import static org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager.WAL_TEMP_NAME_PATTERN;
@@ -235,7 +236,7 @@ public class IgniteNodeStoppedDuringDisableWALTest extends GridCommonAbstractTes
                     if (NodeFileTree.partitionFile(path.toFile()) && path.toFile().length() > pageSize)
                         failed = true;
 
-                    if (name.startsWith(INDEX_FILE_NAME) && path.toFile().length() > pageSize)
+                    if (name.equals(partitionFileName(INDEX_PARTITION)) && path.toFile().length() > pageSize)
                         failed = true;
 
                     if (failed)
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsIndexingDefragmentationTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsIndexingDefragmentationTest.java
index 81332ba0cdf..33119b744d9 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsIndexingDefragmentationTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgnitePdsIndexingDefragmentationTest.java
@@ -48,7 +48,8 @@ import org.jetbrains.annotations.Nullable;
 import org.junit.Test;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
+import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 
 /**
  * Defragmentation tests with enabled ignite-indexing.
@@ -129,13 +130,13 @@ public class IgnitePdsIndexingDefragmentationTest extends IgnitePdsDefragmentati
 
         File cacheStorage = ft.cacheStorage(true, GRP_NAME);
 
-        long oldIdxFileLen = new File(cacheStorage, INDEX_FILE_NAME).length();
+        long oldIdxFileLen = new File(cacheStorage, partitionFileName(INDEX_PARTITION)).length();
 
         startGrid(0);
 
         waitForDefragmentation(0);
 
-        long newIdxFileLen = new File(cacheStorage, INDEX_FILE_NAME).length();
+        long newIdxFileLen = new File(cacheStorage, partitionFileName(INDEX_PARTITION)).length();
 
         assertTrue(
             "newIdxFileLen=" + newIdxFileLen + ", oldIdxFileLen=" + oldIdxFileLen,
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexTest.java
index 9dee2364b6e..5c3cffa5445 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexTest.java
@@ -47,7 +47,8 @@ import org.junit.Test;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_ENABLE_EXTRA_INDEX_REBUILD_LOGGING;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
+import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 
 /**
  *
@@ -176,9 +177,10 @@ public class RebuildIndexTest extends GridCommonAbstractTest {
 
         stopGrid(0);
 
-        U.delete(
-            new File(nodeFileTree(U.maskForFileName(getTestIgniteInstanceName(0))).cacheStorage(false, CACHE_NAME), INDEX_FILE_NAME)
-        );
+        U.delete(new File(
+            nodeFileTree(U.maskForFileName(getTestIgniteInstanceName(0))).cacheStorage(false, CACHE_NAME),
+            partitionFileName(INDEX_PARTITION)
+        ));
 
         node = startGrid(0);
 
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexWithHistoricalRebalanceTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexWithHistoricalRebalanceTest.java
index 26fe57bfed8..3fd88a8064a 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexWithHistoricalRebalanceTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/RebuildIndexWithHistoricalRebalanceTest.java
@@ -60,7 +60,8 @@ import org.junit.Test;
 import static org.apache.ignite.IgniteSystemProperties.IGNITE_PDS_WAL_REBALANCE_THRESHOLD;
 import static org.apache.ignite.cache.CacheMode.REPLICATED;
 import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
+import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 
 /**
  * Rebuild index after index.bin remove, when partition is moving.
@@ -218,9 +219,10 @@ public class RebuildIndexWithHistoricalRebalanceTest extends GridCommonAbstractT
 
         SUPPLY_MESSAGE_LATCH.set(new CountDownLatch(1));
 
-        U.delete(
-            new File(nodeFileTree(U.maskForFileName(getTestIgniteInstanceName(1))).cacheStorage(false, CACHE_NAME), INDEX_FILE_NAME)
-        );
+        U.delete(new File(
+                nodeFileTree(U.maskForFileName(getTestIgniteInstanceName(1))).cacheStorage(false, CACHE_NAME),
+                partitionFileName(INDEX_PARTITION)
+        ));
 
         LogListener rebuildLsnr = finishIndexRebuildLsnr(CACHE_NAME);
 
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/WalDisabledDuringIndexRecreateTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/WalDisabledDuringIndexRecreateTest.java
index 5064b6e1d1e..5478ac0d1da 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/WalDisabledDuringIndexRecreateTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/database/WalDisabledDuringIndexRecreateTest.java
@@ -65,7 +65,7 @@ import static org.apache.ignite.configuration.DataStorageConfiguration.UNLIMITED
 import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
 import static org.apache.ignite.internal.processors.cache.GridCacheUtils.cacheGroupId;
 import static org.apache.ignite.internal.processors.cache.GridCacheUtils.cacheId;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 import static org.apache.ignite.internal.processors.query.schema.management.SortedIndexDescriptorFactory.H2_TREE;
 
 /** */
@@ -298,7 +298,8 @@ public class WalDisabledDuringIndexRecreateTest extends GridCommonAbstractTest {
 
         File idxFile = new File(
             ft.cacheStorage(cacheGrps, cacheGrps ? cacheGroupName() : cacheName()),
-            INDEX_FILE_NAME);
+            partitionFileName(INDEX_PARTITION)
+        );
 
         assertTrue("Index file not found", idxFile.exists());
 
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildSelfTest.java
index adef89003b0..ac0a84bd31e 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/GridIndexRebuildSelfTest.java
@@ -47,7 +47,8 @@ import org.junit.Test;
 
 import static java.util.Objects.nonNull;
 import static java.util.Objects.requireNonNull;
-import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.INDEX_FILE_NAME;
+import static org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION;
+import static org.apache.ignite.internal.processors.cache.persistence.filename.NodeFileTree.partitionFileName;
 import static org.apache.ignite.internal.processors.query.QueryUtils.DFLT_SCHEMA;
 import static org.apache.ignite.internal.util.IgniteUtils.delete;
 
@@ -301,7 +302,7 @@ public class GridIndexRebuildSelfTest extends DynamicIndexAbstractSelfTest {
         File cacheWorkDir = internalCache.context().kernalContext().pdsFolderResolver().fileTree()
             .cacheStorage(internalCache.configuration());
 
-        return cacheWorkDir.toPath().resolve(INDEX_FILE_NAME).toFile();
+        return cacheWorkDir.toPath().resolve(partitionFileName(INDEX_PARTITION)).toFile();
     }
 
     /**