Class HBackupFileSystem

java.lang.Object
org.apache.hadoop.hbase.backup.HBackupFileSystem

@Private public final class HBackupFileSystem extends Object
View to an on-disk Backup Image FileSytem Provides the set of methods necessary to interact with the on-disk Backup Image data.
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
  • Constructor Details

  • Method Details

    • getTableBackupDir

      public static String getTableBackupDir(String backupRootDir, String backupId, TableName tableName)
      Given the backup root dir, backup id and the table name, return the backup image location, which is also where the backup manifest file is. return value look like: "hdfs://backup.hbase.org:9000/user/biadmin/backup/backup_1396650096738/default/t1_dn/", where "hdfs://backup.hbase.org:9000/user/biadmin/backup" is a backup root directory
      Parameters:
      backupRootDir - backup root directory
      backupId - backup id
      tableName - table name
      Returns:
      backupPath String for the particular table
    • getBackupTmpDirPath

      public static org.apache.hadoop.fs.Path getBackupTmpDirPath(String backupRootDir)
      Get backup temporary directory
      Parameters:
      backupRootDir - backup root
      Returns:
      backup tmp directory path
    • getBackupTmpDirPathForBackupId

      public static org.apache.hadoop.fs.Path getBackupTmpDirPathForBackupId(String backupRoot, String backupId)
      Get backup tmp directory for backupId
      Parameters:
      backupRoot - backup root
      backupId - backup id
      Returns:
      backup tmp directory path
    • getTableBackupDataDir

      public static String getTableBackupDataDir(String backupRootDir, String backupId, TableName tableName)
    • getBackupPath

      public static org.apache.hadoop.fs.Path getBackupPath(String backupRootDir, String backupId)
    • getTableBackupPath

      public static org.apache.hadoop.fs.Path getTableBackupPath(TableName tableName, org.apache.hadoop.fs.Path backupRootPath, String backupId)
      Given the backup root dir, backup id and the table name, return the backup image location, which is also where the backup manifest file is. return value look like: "hdfs://backup.hbase.org:9000/user/biadmin/backup/backup_1396650096738/default/t1_dn/", where "hdfs://backup.hbase.org:9000/user/biadmin/backup" is a backup root directory
      Parameters:
      backupRootPath - backup root path
      tableName - table name
      backupId - backup Id
      Returns:
      backupPath for the particular table
    • getLogBackupDir

      public static String getLogBackupDir(String backupRootDir, String backupId)
      Given the backup root dir and the backup id, return the log file location for an incremental backup.
      Parameters:
      backupRootDir - backup root directory
      backupId - backup id
      Returns:
      logBackupDir: ".../user/biadmin/backup/WALs/backup_1396650096738"
    • getLogBackupPath

      public static org.apache.hadoop.fs.Path getLogBackupPath(String backupRootDir, String backupId)
    • getManifestPath

      private static org.apache.hadoop.fs.Path getManifestPath(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) throws IOException
      Throws:
      IOException
    • getManifest

      public static BackupManifest getManifest(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) throws IOException
      Throws:
      IOException
    • checkImageManifestExist

      public static void checkImageManifestExist(HashMap<TableName,BackupManifest> backupManifestMap, TableName[] tableArray, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path backupRootPath, String backupId) throws IOException
      Check whether the backup image path and there is manifest file in the path.
      Parameters:
      backupManifestMap - If all the manifests are found, then they are put into this map
      tableArray - the tables involved
      Throws:
      IOException - exception