Class BackupFileSystemManager
java.lang.Object
org.apache.hadoop.hbase.backup.util.BackupFileSystemManager
Initializes and organizes backup directories for continuous Write-Ahead Logs (WALs) and
bulk-loaded files within the specified backup root directory.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hadoop.fs.FileSystemprivate final org.apache.hadoop.fs.Pathstatic final Stringprivate final org.apache.hadoop.fs.Pathprivate static final org.slf4j.Loggerprivate final Stringstatic final Stringprivate final org.apache.hadoop.fs.Path -
Constructor Summary
ConstructorsConstructorDescriptionBackupFileSystemManager(String peerId, org.apache.hadoop.conf.Configuration conf, String backupRootDirStr) -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.fs.PathcreateDirectory(String dirName) extractWalPathInfo(org.apache.hadoop.fs.Path walPath) Validate the walPath has the expected structure: .../WALs//<wal-file> and return WalPathInfo(prefixBeforeWALs, dateSegment). org.apache.hadoop.fs.FileSystemorg.apache.hadoop.fs.Pathorg.apache.hadoop.fs.Pathstatic org.apache.hadoop.fs.PathresolveBulkLoadFullPath(org.apache.hadoop.fs.Path walPath, org.apache.hadoop.fs.Path relativeBulkPath) Resolve the full bulk-load file path corresponding to a relative bulk-load path referenced from a WAL file path.
-
Field Details
-
LOG
-
WALS_DIR
- See Also:
-
BULKLOAD_FILES_DIR
- See Also:
-
peerId
-
backupFs
-
backupRootDir
-
walsDir
-
bulkLoadFilesDir
-
-
Constructor Details
-
BackupFileSystemManager
public BackupFileSystemManager(String peerId, org.apache.hadoop.conf.Configuration conf, String backupRootDirStr) throws IOException - Throws:
IOException
-
-
Method Details
-
createDirectory
- Throws:
IOException
-
getWalsDir
-
getBulkLoadFilesDir
-
getBackupFs
-
extractWalPathInfo
public static BackupFileSystemManager.WalPathInfo extractWalPathInfo(org.apache.hadoop.fs.Path walPath) throws IOException Validate the walPath has the expected structure: .../WALs//<wal-file> and return WalPathInfo(prefixBeforeWALs, dateSegment). - Throws:
IOException- if the path is not in expected format
-
resolveBulkLoadFullPath
public static org.apache.hadoop.fs.Path resolveBulkLoadFullPath(org.apache.hadoop.fs.Path walPath, org.apache.hadoop.fs.Path relativeBulkPath) throws IOException Resolve the full bulk-load file path corresponding to a relative bulk-load path referenced from a WAL file path. For a WAL path like: /some/prefix/.../WALs/23-08-2025/some-wal-file and a relative bulk path like: namespace/table/region/family/file, this returns: /some/prefix/.../bulk-load-files/23-08-2025/namespace/table/region/family/file- Parameters:
walPath- the Path to the WAL file (must contain theWALS_DIRsegment followed by date)relativeBulkPath- the relative bulk-load file Path- Returns:
- resolved full Path for the bulk-load file
- Throws:
IOException- if the WAL path does not contain the expected segments
-