public class DefragmentationFileUtils extends Object
| Constructor and Description |
|---|
DefragmentationFileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
batchRenameDefragmentedCacheGroupPartitions(File workDir,
IgniteLogger log)
Failure-tolerant batch rename of defragmented partition files.
|
static void |
beforeInitPageStores(File workDir,
IgniteLogger log)
Performs cleanup of work dir before initializing file page stores.
|
static File |
defragmentationCompletionMarkerFile(File workDir)
Return defragmentation completion marker file.
|
static File |
defragmentedIndexFile(File workDir)
Return file named
index-dfrg.bin in given folder. |
static File |
defragmentedIndexTmpFile(File workDir)
Return file named
index-dfrg.bin.tmp in given folder. |
static File |
defragmentedPartFile(File workDir,
int partId)
Return file named
part-dfrg-%d.bin in given folder. |
static File |
defragmentedPartMappingFile(File workDir,
int partId)
Return file named
part-map-%d.bin in given folder. |
static File |
defragmentedPartTmpFile(File workDir,
int partId)
Return file named
part-dfrg-%d.bin.tmp in given folder. |
static void |
deleteLeftovers(File workDir)
Deletes all defragmentation related file from work directory, except for completion marker.
|
static void |
renameTempIndexFile(File workDir)
Rename temporary index defragmentation file to a finalized one.
|
static void |
renameTempPartitionFile(File workDir,
int partId)
Rename temporary partition defragmentation file to a finalized one.
|
static boolean |
skipAlreadyDefragmentedCacheGroup(File workDir,
int grpId,
IgniteLogger log)
Checks whether cache group defragmentation completed or not.
|
static boolean |
skipAlreadyDefragmentedPartition(File workDir,
int grpId,
int partId,
IgniteLogger log)
Checks whether partition has already been defragmented or not.
|
static void |
writeDefragmentationCompletionMarker(FileIOFactory ioFactory,
File workDir,
IgniteLogger log)
Creates empty completion marker file in given directory.
|
public static void beforeInitPageStores(File workDir, IgniteLogger log) throws IgniteCheckedException
workDir - Cache group working directory.log - Logger to write messages.IgniteCheckedException - If IOException occurred.public static void deleteLeftovers(File workDir)
workDir - Cache group working directory.public static boolean skipAlreadyDefragmentedCacheGroup(File workDir, int grpId, IgniteLogger log) throws IgniteException
workDir - Cache group working directory.grpId - Cache group Id of cache group belonging to the given working directory.log - Logger to write messages.true if given cache group is already defragmented.IgniteException - If IOException occurred.defragmentationCompletionMarkerFile(File)public static boolean skipAlreadyDefragmentedPartition(File workDir, int grpId, int partId, IgniteLogger log) throws IgniteException
workDir - Cache group working directory.grpId - Cache group Id of cache group belonging to the given working directory.partId - Partition index to check.log - Logger to write messages.true if given partition is already defragmented.IgniteException - If IOException occurred.defragmentedPartTmpFile(File, int),
defragmentedPartFile(File, int),
defragmentedPartMappingFile(File, int)public static void batchRenameDefragmentedCacheGroupPartitions(File workDir, IgniteLogger log) throws IgniteException
workDir - Cache group working directory.log - Logger to write messages.IgniteException - If IOException occurred.writeDefragmentationCompletionMarker(FileIOFactory, File, IgniteLogger)public static File defragmentedIndexTmpFile(File workDir)
index-dfrg.bin.tmp in given folder. It will be used for storing defragmented index
partition during the process.workDir - Cache group working directory.defragmentedIndexFile(File)public static File defragmentedIndexFile(File workDir)
index-dfrg.bin in given folder. It will be used for storing defragmented index
partition when the process is over.workDir - Cache group working directory.defragmentedIndexTmpFile(File)public static void renameTempIndexFile(File workDir) throws IgniteException
workDir - Cache group working directory.IgniteException - If IOException occurred.defragmentedIndexTmpFile(File),
defragmentedIndexFile(File)public static File defragmentedPartTmpFile(File workDir, int partId)
part-dfrg-%d.bin.tmp in given folder. It will be used for storing defragmented data
partition during the process.workDir - Cache group working directory.partId - Partition index, will be substituted into file name.defragmentedPartFile(File, int)public static File defragmentedPartFile(File workDir, int partId)
part-dfrg-%d.bin in given folder. It will be used for storing defragmented data
partition when the process is over.workDir - Cache group working directory.partId - Partition index, will be substituted into file name.defragmentedPartTmpFile(File, int)public static void renameTempPartitionFile(File workDir, int partId) throws IgniteException
workDir - Cache group working directory.partId - Partition index.IgniteException - If IOException occurred.defragmentedPartTmpFile(File, int),
defragmentedPartFile(File, int)public static File defragmentedPartMappingFile(File workDir, int partId)
part-map-%d.bin in given folder. It will be used for storing defragmention links
mapping for given partition during and after defragmentation process. No temporary counterpart is required here.workDir - Cache group working directory.partId - Partition index, will be substituted into file name.LinkMappublic static File defragmentationCompletionMarkerFile(File workDir)
*.tmp versions. Presence of this file signals that no data
will be lost if original partitions are deleted and batch rename process can be safely initiated.workDir - Cache group working directory.writeDefragmentationCompletionMarker(FileIOFactory, File, IgniteLogger),
batchRenameDefragmentedCacheGroupPartitions(File, IgniteLogger)public static void writeDefragmentationCompletionMarker(FileIOFactory ioFactory, File workDir, IgniteLogger log) throws IgniteException
ioFactory - File IO factory.workDir - Cache group working directory.log - Logger to write messages.IgniteException - If IOException occurred.defragmentationCompletionMarkerFile(File)
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021