public class ChecksumMigration extends Object
Constructor and Description |
---|
ChecksumMigration() |
Modifier and Type | Method and Description |
---|---|
static void |
maybeMigrateChecksumFormat(Algorithm checksumAlgorithm,
short checksumSuperBlockLength,
Path path)
maybeMigrateChecksumFormat is a helper util to migrate a given file path into the checksumAlgorithm file format.
|
static void |
maybeRemovePreviousFormatPath(Path path)
maybeRemovePreviousFormatPath is a helper util to delete (if exists) the previous format file.
|
static Path |
previousFormatPath(Path path)
previousFormatPath is a helper util to generate the path for previous format path.
|
public static void maybeMigrateChecksumFormat(Algorithm checksumAlgorithm, short checksumSuperBlockLength, Path path) throws IOException
checksumAlgorithm
- the destination checksum algorithm to be migrated tochecksumSuperBlockLength
- the checksum super block length for destinationpath
- the input file pathIOException
- If any I/O error occurspublic static Path previousFormatPath(Path path)
path
- the input file pathpublic static void maybeRemovePreviousFormatPath(Path path) throws IOException
path
- the current file pathIOException
- If any I/O error occurs