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 TypeMethodDescriptionvoid
addToBackupSet
(String name, TableName[] tables) Add tables to backup set commandbackupTables
(BackupRequest userRequest) Backup given list of tables fully.int
deleteBackups
(String[] backupIds) Delete backup image commandboolean
deleteBackupSet
(String name) Delete backup set commandgetBackupInfo
(String backupId) Describe backup image commandgetBackupSet
(String name) Backup set describe command.getHistory
(int n) Show backup history commandgetHistory
(int n, BackupInfo.Filter... f) Show backup history command with filtersBackup sets list command - list all backup sets.void
mergeBackups
(String[] backupIds) Merge backup images commandvoid
removeFromBackupSet
(String name, TableName[] tables) Remove tables from backup setvoid
restore
(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
Show backup history command- Parameters:
n
- last n backup sessions- Returns:
- list of backup info objects
- Throws:
IOException
- exception
-
getHistory
Show backup history command with filters- Parameters:
n
- last n backup sessionsf
- list of filters- Returns:
- list of backup info objects
- 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
-