Package org.apache.hadoop.hbase.backup
Class HBackupFileSystem
java.lang.Object
org.apache.hadoop.hbase.backup.HBackupFileSystem
View to an on-disk Backup Image FileSytem Provides the set of methods necessary to interact with
the on-disk Backup Image data.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkImageManifestExist
(HashMap<TableName, BackupManifest> backupManifestMap, TableName[] tableArray, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) Check whether the backup image path and there is manifest file in the path.static org.apache.hadoop.fs.Path
getBackupPath
(String backupRootDir, String backupId) static org.apache.hadoop.fs.Path
getBackupTmpDirPath
(String backupRootDir) Get backup temporary directorystatic org.apache.hadoop.fs.Path
getBackupTmpDirPathForBackupId
(String backupRoot, String backupId) Get backup tmp directory for backupIdstatic String
getLogBackupDir
(String backupRootDir, String backupId) Given the backup root dir and the backup id, return the log file location for an incremental backup.static org.apache.hadoop.fs.Path
getLogBackupPath
(String backupRootDir, String backupId) static BackupManifest
getManifest
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) private static org.apache.hadoop.fs.Path
getManifestPath
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) static String
getTableBackupDataDir
(String backupRootDir, String backupId, TableName tableName) static String
getTableBackupDir
(String backupRootDir, String backupId, TableName tableName) Given the backup root dir, backup id and the table name, return the backup image location, which is also where the backup manifest file is.static org.apache.hadoop.fs.Path
getTableBackupPath
(TableName tableName, org.apache.hadoop.fs.Path backupRootPath, String backupId) Given the backup root dir, backup id and the table name, return the backup image location, which is also where the backup manifest file is.
-
Field Details
-
LOG
-
-
Constructor Details
-
HBackupFileSystem
private HBackupFileSystem()This is utility class.
-
-
Method Details
-
getTableBackupDir
Given the backup root dir, backup id and the table name, return the backup image location, which is also where the backup manifest file is. return value look like: "hdfs://backup.hbase.org:9000/user/biadmin/backup/backup_1396650096738/default/t1_dn/", where "hdfs://backup.hbase.org:9000/user/biadmin/backup" is a backup root directory- Parameters:
backupRootDir
- backup root directorybackupId
- backup idtableName
- table name- Returns:
- backupPath String for the particular table
-
getBackupTmpDirPath
Get backup temporary directory- Parameters:
backupRootDir
- backup root- Returns:
- backup tmp directory path
-
getBackupTmpDirPathForBackupId
public static org.apache.hadoop.fs.Path getBackupTmpDirPathForBackupId(String backupRoot, String backupId) Get backup tmp directory for backupId- Parameters:
backupRoot
- backup rootbackupId
- backup id- Returns:
- backup tmp directory path
-
getTableBackupDataDir
public static String getTableBackupDataDir(String backupRootDir, String backupId, TableName tableName) -
getBackupPath
-
getTableBackupPath
public static org.apache.hadoop.fs.Path getTableBackupPath(TableName tableName, org.apache.hadoop.fs.Path backupRootPath, String backupId) Given the backup root dir, backup id and the table name, return the backup image location, which is also where the backup manifest file is. return value look like: "hdfs://backup.hbase.org:9000/user/biadmin/backup/backup_1396650096738/default/t1_dn/", where "hdfs://backup.hbase.org:9000/user/biadmin/backup" is a backup root directory- Parameters:
backupRootPath
- backup root pathtableName
- table namebackupId
- backup Id- Returns:
- backupPath for the particular table
-
getLogBackupDir
Given the backup root dir and the backup id, return the log file location for an incremental backup.- Parameters:
backupRootDir
- backup root directorybackupId
- backup id- Returns:
- logBackupDir: ".../user/biadmin/backup/WALs/backup_1396650096738"
-
getLogBackupPath
-
getManifestPath
private static org.apache.hadoop.fs.Path getManifestPath(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) throws IOException - Throws:
IOException
-
getManifest
public static BackupManifest getManifest(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) throws IOException - Throws:
IOException
-
checkImageManifestExist
public static void checkImageManifestExist(HashMap<TableName, BackupManifest> backupManifestMap, TableName[] tableArray, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) throws IOExceptionCheck whether the backup image path and there is manifest file in the path.- Parameters:
backupManifestMap
- If all the manifests are found, then they are put into this maptableArray
- the tables involved- Throws:
IOException
- exception
-