Class MapReduceBackupMergeJob
java.lang.Object
org.apache.hadoop.hbase.backup.mapreduce.MapReduceBackupMergeJob
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,BackupMergeJob
MapReduce implementation of
BackupMergeJob
Must be initialized with configuration of a
backup destination cluster-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanupBulkLoadDirs
(org.apache.hadoop.fs.FileSystem fs, List<org.apache.hadoop.fs.Path> pathList) protected org.apache.hadoop.fs.Path
convertToDest
(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.Path backupDirPath) Converts path before copyingprotected void
copyFile
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.Path newPath) Copy file in DFS from p to newPathprotected void
copyMetaData
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tmpBackupDir, org.apache.hadoop.fs.Path backupDirPath) Copy meta data to of a backup sessionprotected void
deleteBackupImages
(List<String> backupIds, Connection conn, org.apache.hadoop.fs.FileSystem fs, String backupRoot) protected org.apache.hadoop.fs.Path[]
findInputDirectories
(org.apache.hadoop.fs.FileSystem fs, String backupRoot, TableName tableName, String[] backupIds) getBackupIdsToDelete
(String[] backupIds, String mergedBackupId) org.apache.hadoop.conf.Configuration
getConf()
protected TableName[]
getTableNamesInBackupImages
(String[] backupIds) protected void
moveData
(org.apache.hadoop.fs.FileSystem fs, String backupRoot, org.apache.hadoop.fs.Path bulkOutputPath, TableName tableName, String mergedBackupId) void
Run backup merge operation.void
setConf
(org.apache.hadoop.conf.Configuration conf) protected List<org.apache.hadoop.fs.Path>
toPathList
(List<Pair<TableName, org.apache.hadoop.fs.Path>> processedTableList) toTableNameList
(List<Pair<TableName, org.apache.hadoop.fs.Path>> processedTableList) protected void
updateBackupManifest
(String backupRoot, String mergedBackupId, List<String> backupsToDelete)
-
Field Details
-
LOG
-
player
-
conf
-
-
Constructor Details
-
MapReduceBackupMergeJob
public MapReduceBackupMergeJob()
-
-
Method Details
-
getConf
- Specified by:
getConf
in interfaceorg.apache.hadoop.conf.Configurable
-
setConf
- Specified by:
setConf
in interfaceorg.apache.hadoop.conf.Configurable
-
run
Description copied from interface:BackupMergeJob
Run backup merge operation.- Specified by:
run
in interfaceBackupMergeJob
- Parameters:
backupIds
- backup image ids- Throws:
IOException
- if the backup merge operation fails
-
copyMetaData
protected void copyMetaData(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path tmpBackupDir, org.apache.hadoop.fs.Path backupDirPath) throws IOException Copy meta data to of a backup session- Parameters:
fs
- file systemtmpBackupDir
- temp backup directory, where meta is locaedbackupDirPath
- new path for backup- Throws:
IOException
- exception
-
copyFile
protected void copyFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.Path newPath) throws IOException Copy file in DFS from p to newPath- Parameters:
fs
- file systemp
- old pathnewPath
- new path- Throws:
IOException
- exception
-
convertToDest
protected org.apache.hadoop.fs.Path convertToDest(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.Path backupDirPath) Converts path before copying- Parameters:
p
- pathbackupDirPath
- backup root- Returns:
- converted path
-
toPathList
protected List<org.apache.hadoop.fs.Path> toPathList(List<Pair<TableName, org.apache.hadoop.fs.Path>> processedTableList) -
toTableNameList
-
cleanupBulkLoadDirs
protected void cleanupBulkLoadDirs(org.apache.hadoop.fs.FileSystem fs, List<org.apache.hadoop.fs.Path> pathList) throws IOException - Throws:
IOException
-
updateBackupManifest
protected void updateBackupManifest(String backupRoot, String mergedBackupId, List<String> backupsToDelete) throws IllegalArgumentException, IOException - Throws:
IllegalArgumentException
IOException
-
deleteBackupImages
protected void deleteBackupImages(List<String> backupIds, Connection conn, org.apache.hadoop.fs.FileSystem fs, String backupRoot) throws IOException - Throws:
IOException
-
getBackupIdsToDelete
-
moveData
protected void moveData(org.apache.hadoop.fs.FileSystem fs, String backupRoot, org.apache.hadoop.fs.Path bulkOutputPath, TableName tableName, String mergedBackupId) throws IllegalArgumentException, IOException - Throws:
IllegalArgumentException
IOException
-
getTableNamesInBackupImages
- Throws:
IOException
-
findInputDirectories
protected org.apache.hadoop.fs.Path[] findInputDirectories(org.apache.hadoop.fs.FileSystem fs, String backupRoot, TableName tableName, String[] backupIds) throws IOException - Throws:
IOException
-