Class MapReduceBackupCopyJob
java.lang.Object
org.apache.hadoop.hbase.backup.mapreduce.MapReduceBackupCopyJob
- All Implemented Interfaces:
org.apache.hadoop.conf.Configurable
,BackupCopyJob
Map-Reduce implementation of
BackupCopyJob
. Basically, there are 2 types of copy
operation: one is copying from snapshot, which bases on extending ExportSnapshot's function, the
other is copying for incremental log files, which bases on extending DistCp's function.-
Nested Class Summary
Modifier and TypeClassDescription(package private) class
Extends DistCp for progress updating to backup system table during backup.(package private) static class
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancel copy jobint
copy
(BackupInfo context, BackupManager backupManager, org.apache.hadoop.conf.Configuration conf, BackupType copyType, String[] options) Do backup copy based on different types.org.apache.hadoop.conf.Configuration
getConf()
float
Get the current copy task percentage within the whole task if multiple copies are needed.parseDistCpOptions
(org.apache.hadoop.conf.Configuration conf) void
setConf
(org.apache.hadoop.conf.Configuration conf) void
setSubTaskPercntgInWholeTask
(float subTaskPercntgInWholeTask) Set the current copy task percentage within the whole task if multiple copies are needed.(package private) static void
updateProgress
(BackupInfo backupInfo, BackupManager backupManager, int newProgress, long bytesCopied) Update the ongoing backup with new progress.
-
Field Details
-
NUMBER_OF_LEVELS_TO_PRESERVE_KEY
- See Also:
-
BACKUP_COPY_OPTION_PREFIX
- See Also:
-
LOG
-
conf
-
progressDone
-
bytesCopied
-
INIT_PROGRESS
-
subTaskPercntgInWholeTask
-
-
Constructor Details
-
MapReduceBackupCopyJob
public MapReduceBackupCopyJob()
-
-
Method Details
-
getConf
- Specified by:
getConf
in interfaceorg.apache.hadoop.conf.Configurable
-
setConf
- Specified by:
setConf
in interfaceorg.apache.hadoop.conf.Configurable
-
getSubTaskPercntgInWholeTask
Get the current copy task percentage within the whole task if multiple copies are needed.- Returns:
- the current copy task percentage
-
setSubTaskPercntgInWholeTask
Set the current copy task percentage within the whole task if multiple copies are needed. Must be called before callingcopy(BackupInfo, BackupManager, Configuration, BackupType, String[])
- Parameters:
subTaskPercntgInWholeTask
- The percentage of the copy subtask
-
updateProgress
static void updateProgress(BackupInfo backupInfo, BackupManager backupManager, int newProgress, long bytesCopied) throws IOException Update the ongoing backup with new progress.- Parameters:
backupInfo
- backup infonewProgress
- progressbytesCopied
- bytes copied- Throws:
IOException
- exception
-
copy
public int copy(BackupInfo context, BackupManager backupManager, org.apache.hadoop.conf.Configuration conf, BackupType copyType, String[] options) throws IOException Do backup copy based on different types.- Specified by:
copy
in interfaceBackupCopyJob
- Parameters:
context
- The backup infoconf
- The hadoop configurationcopyType
- The backup copy typeoptions
- Options for customized ExportSnapshot or DistCpbackupManager
- backup manager- Returns:
- result (0 - success, -1 failure )
- Throws:
IOException
- exception
-
cancel
Description copied from interface:BackupCopyJob
Cancel copy job- Specified by:
cancel
in interfaceBackupCopyJob
- Parameters:
jobId
- backup copy job handler- Throws:
IOException
- if cancelling the jobs fails
-
parseDistCpOptions
-