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 SummaryNested ClassesModifier and TypeClassDescription(package private) classExtends DistCp for progress updating to backup system table during backup.(package private) static class
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate longprivate org.apache.hadoop.conf.Configurationprivate static floatprivate static final org.slf4j.Loggerstatic final Stringprivate floatprivate float
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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- 
MapReduceBackupCopyJobpublic MapReduceBackupCopyJob()
 
- 
- 
Method Details- 
getConf- Specified by:
- getConfin interface- org.apache.hadoop.conf.Configurable
 
- 
setConf- Specified by:
- setConfin interface- org.apache.hadoop.conf.Configurable
 
- 
getSubTaskPercntgInWholeTaskGet the current copy task percentage within the whole task if multiple copies are needed.- Returns:
- the current copy task percentage
 
- 
setSubTaskPercntgInWholeTaskSet 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
 
- 
updateProgressstatic void updateProgress(BackupInfo backupInfo, BackupManager backupManager, int newProgress, long bytesCopied) throws IOException Update the ongoing backup with new progress.- Parameters:
- backupInfo- backup info
- newProgress- progress
- bytesCopied- bytes copied
- Throws:
- IOException- exception
 
- 
copypublic 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 interface- BackupCopyJob
- Parameters:
- context- The backup info
- conf- The hadoop configuration
- copyType- The backup copy type
- options- Options for customized ExportSnapshot or DistCp
- backupManager- backup manager
- Returns:
- result (0 - success, -1 failure )
- Throws:
- IOException- exception
 
- 
cancelDescription copied from interface:BackupCopyJobCancel copy job- Specified by:
- cancelin interface- BackupCopyJob
- Parameters:
- jobId- backup copy job handler
- Throws:
- IOException- if cancelling the jobs fails
 
 
-