Class OmSnapshotUtils
java.lang.Object
org.apache.hadoop.ozone.om.snapshot.OmSnapshotUtils
Ozone Manager Snapshot Utilities.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PathcreateHardLinkList(int truncateLength, Map<Path, Path> hardLinkFiles) Create file of links to add to tarball.static voidcreateHardLinks(Path dbPath) Create hard links listed in OM_HARDLINK_FILE.static ObjectGet the INode for file.static voidLink each of the files in oldDir to newDir.static StringtruncateFileName(int truncateLength, Path file) Get the filename without the introductory metadata directory.
-
Field Details
-
DATA_PREFIX
- See Also:
-
DATA_SUFFIX
- See Also:
-
-
Method Details
-
truncateFileName
Get the filename without the introductory metadata directory.- Parameters:
truncateLength- Length to remove.file- File to remove prefix from.- Returns:
- Truncated string.
-
getINode
Get the INode for file.- Parameters:
file- File whose INode is to be retrieved.- Returns:
- INode for file.
- Throws:
IOException
-
createHardLinkList
public static Path createHardLinkList(int truncateLength, Map<Path, Path> hardLinkFiles) throws IOExceptionCreate file of links to add to tarball. Format of entries are either: dir1/fileTo fileFrom for files in active db or: dir1/fileTo dir2/fileFrom for files in another directory, (either another snapshot dir or sst compaction backup directory)- Parameters:
truncateLength- - Length of initial path to trim in file path.hardLinkFiles- - Map of link->file paths.- Returns:
- Path to the file of links created.
- Throws:
IOException
-
createHardLinks
Create hard links listed in OM_HARDLINK_FILE.- Parameters:
dbPath- Path to db to have links created.- Throws:
IOException
-
linkFiles
Link each of the files in oldDir to newDir.- Parameters:
oldDir- The dir to create links from.newDir- The dir to create links to.- Throws:
IOException
-