Package org.apache.hadoop.hbase.backup
Interface BackupAdmin
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
BackupAdminImpl
The administrative API for HBase Backup. Construct an instance and call
Closeable.close()
afterwards.
BackupAdmin can be used to create backups, restore data from backups and for other backup-related operations.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddToBackupSet(String name, TableName[] tables) Add tables to backup set commandbackupTables(BackupRequest userRequest) Backup given list of tables fully.intdeleteBackups(String[] backupIds) Delete backup image commandbooleandeleteBackupSet(String name) Delete backup set commandgetBackupInfo(String backupId) Describe backup image commandgetBackupSet(String name) Backup set describe command.getHistory(int n, BackupInfo.Filter... f) Retrieve info about the most recent backups.Backup sets list command - list all backup sets.voidmergeBackups(String[] backupIds) Merge backup images commandvoidremoveFromBackupSet(String name, TableName[] tables) Remove tables from backup setvoidrestore(RestoreRequest request) Restore backup
-
Method Details
-
backupTables
Backup given list of tables fully. This is a synchronous operation. It returns backup id on success or throw exception on failure.- Parameters:
userRequest- BackupRequest instance- Returns:
- the backup Id
- Throws:
IOException
-
restore
Restore backup- Parameters:
request- restore request- Throws:
IOException- exception
-
getBackupInfo
Describe backup image command- Parameters:
backupId- backup id- Returns:
- backup info
- Throws:
IOException- exception
-
deleteBackups
Delete backup image command- Parameters:
backupIds- array of backup ids- Returns:
- total number of deleted sessions
- Throws:
IOException- exception
-
mergeBackups
Merge backup images command- Parameters:
backupIds- array of backup ids of images to be merged The resulting backup image will have the same backup id as the most recent image from a list of images to be merged- Throws:
IOException- exception
-
getHistory
Retrieve info about the most recent backups.- Parameters:
n- number of backup infos desiredf- optional filters, only entries passing the filters will be returned- Returns:
- a list of at most n entries, ordered from newest (most recent) to oldest (least recent)
- Throws:
IOException- exception
-
listBackupSets
Backup sets list command - list all backup sets. Backup set is a named group of tables.- Returns:
- all registered backup sets
- Throws:
IOException- exception
-
getBackupSet
Backup set describe command. Shows list of tables in this particular backup set.- Parameters:
name- set name- Returns:
- backup set description or null
- Throws:
IOException- exception
-
deleteBackupSet
Delete backup set command- Parameters:
name- backup set name- Returns:
- true, if success, false - otherwise
- Throws:
IOException- exception
-
addToBackupSet
Add tables to backup set command- Parameters:
name- name of backup set.tables- array of tables to be added to this set.- Throws:
IOException- exception
-
removeFromBackupSet
Remove tables from backup set- Parameters:
name- name of backup set.tables- array of tables to be removed from this set.- Throws:
IOException- exception
-