@InterfaceAudience.Private @InterfaceStability.Evolving public class HBaseBackupAdmin extends Object implements BackupAdmin
Admin.getBackupAdmin()
and call close()
afterwards.
BackupAdmin can be used to create backups, restore data from backups and for other backup-related operations.
Admin
Modifier and Type | Method and Description |
---|---|
void |
addToBackupSet(String name,
TableName[] tables)
Add tables to backup set command
|
String |
backupTables(BackupRequest userRequest)
Backs up given list of tables fully.
|
Future<String> |
backupTablesAsync(BackupRequest userRequest)
Backs up given list of tables fully.
|
void |
close() |
int |
deleteBackups(String[] backupIds)
Delete backup image command
|
boolean |
deleteBackupSet(String name)
Delete backup set command
|
BackupInfo |
getBackupInfo(String backupId)
Describe backup image command
|
BackupSet |
getBackupSet(String name)
Backup set describe command.
|
List<BackupInfo> |
getHistory(int n)
Show backup history command
|
int |
getProgress(String backupId)
Show backup progress command
|
List<BackupSet> |
listBackupSets()
Backup sets list command - list all backup sets.
|
void |
removeFromBackupSet(String name,
String[] tables)
Remove tables from backup set
|
void |
restore(RestoreRequest request)
Restore backup
|
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public BackupInfo getBackupInfo(String backupId) throws IOException
BackupAdmin
getBackupInfo
in interface BackupAdmin
backupId
- - backup idIOException
- exceptionpublic int getProgress(String backupId) throws IOException
BackupAdmin
getProgress
in interface BackupAdmin
backupId
- - backup id (may be null)IOException
- exceptionpublic int deleteBackups(String[] backupIds) throws IOException
BackupAdmin
deleteBackups
in interface BackupAdmin
backupIds
- - backup idIOException
- exceptionpublic List<BackupInfo> getHistory(int n) throws IOException
BackupAdmin
getHistory
in interface BackupAdmin
n
- - last n backup sessionsIOException
- exceptionpublic List<BackupSet> listBackupSets() throws IOException
BackupAdmin
listBackupSets
in interface BackupAdmin
IOException
- exceptionpublic BackupSet getBackupSet(String name) throws IOException
BackupAdmin
getBackupSet
in interface BackupAdmin
name
- set nameIOException
- exceptionpublic boolean deleteBackupSet(String name) throws IOException
BackupAdmin
deleteBackupSet
in interface BackupAdmin
name
- - backup set nameIOException
- exceptionpublic void addToBackupSet(String name, TableName[] tables) throws IOException
BackupAdmin
addToBackupSet
in interface BackupAdmin
name
- - name of backup set.tables
- - list of tables to be added to this set.IOException
- exceptionpublic void removeFromBackupSet(String name, String[] tables) throws IOException
BackupAdmin
removeFromBackupSet
in interface BackupAdmin
name
- - name of backup set.tables
- - list of tables to be removed from this set.IOException
- exceptionpublic void restore(RestoreRequest request) throws IOException
BackupAdmin
restore
in interface BackupAdmin
request
- - restore requestIOException
- exceptionpublic String backupTables(BackupRequest userRequest) throws IOException
BackupAdmin
backupTables
in interface BackupAdmin
IOException
public Future<String> backupTablesAsync(BackupRequest userRequest) throws IOException
BackupAdmin
backupTablesAsync
in interface BackupAdmin
IOException