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
Nested ClassesModifier and TypeClassDescription(package private) classExtends DistCp for progress updating to backup system table during backup.(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate org.apache.hadoop.conf.Configurationprivate static floatprivate static final org.slf4j.Loggerstatic final Stringprivate floatprivate float -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCancel copy jobintcopy(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.ConfigurationgetConf()floatGet the current copy task percentage within the whole task if multiple copies are needed.voidsetConf(org.apache.hadoop.conf.Configuration conf) voidsetSubTaskPercntgInWholeTask(float subTaskPercntgInWholeTask) Set the current copy task percentage within the whole task if multiple copies are needed.(package private) static voidupdateProgress(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:
-
LOG
-
conf
-
progressDone
-
bytesCopied
-
INIT_PROGRESS
-
subTaskPercntgInWholeTask
-
-
Constructor Details
-
MapReduceBackupCopyJob
public MapReduceBackupCopyJob()
-
-
Method Details
-
getConf
- Specified by:
getConfin interfaceorg.apache.hadoop.conf.Configurable
-
setConf
- Specified by:
setConfin 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:
copyin 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:BackupCopyJobCancel copy job- Specified by:
cancelin interfaceBackupCopyJob- Parameters:
jobId- backup copy job handler- Throws:
IOException- if cancelling the jobs fails
-