Class MapReduceBackupCopyJob

java.lang.Object
org.apache.hadoop.hbase.backup.mapreduce.MapReduceBackupCopyJob
All Implemented Interfaces:
org.apache.hadoop.conf.Configurable, BackupCopyJob

@Private public class MapReduceBackupCopyJob extends Object implements 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.
  • Field Details

  • Constructor Details

  • Method Details

    • getConf

      public org.apache.hadoop.conf.Configuration getConf()
      Specified by:
      getConf in interface org.apache.hadoop.conf.Configurable
    • setConf

      public void setConf(org.apache.hadoop.conf.Configuration conf)
      Specified by:
      setConf in interface org.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

      public void setSubTaskPercntgInWholeTask(float subTaskPercntgInWholeTask)
      Set the current copy task percentage within the whole task if multiple copies are needed. Must be called before calling copy(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 info
      newProgress - progress
      bytesCopied - 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 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
    • cancel

      public void cancel(String jobId) throws IOException
      Description copied from interface: BackupCopyJob
      Cancel copy job
      Specified by:
      cancel in interface BackupCopyJob
      Parameters:
      jobId - backup copy job handler
      Throws:
      IOException - if cancelling the jobs fails