Class RestoreTablesClient
java.lang.Object
org.apache.hadoop.hbase.backup.impl.RestoreTablesClient
Restore table implementation
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
private String
private org.apache.hadoop.conf.Configuration
private Connection
private boolean
private static final org.slf4j.Logger
private org.apache.hadoop.fs.Path
private TableName[]
private TableName[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkTargetTables
(TableName[] tTableArray, boolean isOverwrite) Validate target tables.void
execute()
private List<org.apache.hadoop.fs.Path>
getFilesRecursively
(String fileBackupDir) (package private) static long
getTsFromBackupId
(String backupId) private void
restore
(HashMap<TableName, BackupManifest> backupManifestMap, TableName[] sTableArray, TableName[] tTableArray, boolean isOverwrite) Restore operation.private void
restoreImages
(BackupManifest.BackupImage[] images, TableName sTable, TableName tTable, boolean truncateIfExists) Restore operation handle each backupImage in array.(package private) static boolean
withinRange
(long a, long lower, long upper)
-
Field Details
-
LOG
-
conf
-
conn
-
backupId
-
sTableArray
-
tTableArray
-
backupRootDir
-
restoreRootDir
-
isOverwrite
-
-
Constructor Details
-
RestoreTablesClient
- Throws:
IOException
-
-
Method Details
-
checkTargetTables
Validate target tables.- Parameters:
tTableArray
- target tablesisOverwrite
- overwrite existing table- Throws:
IOException
- exception
-
restoreImages
private void restoreImages(BackupManifest.BackupImage[] images, TableName sTable, TableName tTable, boolean truncateIfExists) throws IOException Restore operation handle each backupImage in array.- Parameters:
images
- array BackupImagesTable
- table to be restoredtTable
- table to be restored totruncateIfExists
- truncate table- Throws:
IOException
- exception
-
getFilesRecursively
private List<org.apache.hadoop.fs.Path> getFilesRecursively(String fileBackupDir) throws IllegalArgumentException, IOException - Throws:
IllegalArgumentException
IOException
-
restore
private void restore(HashMap<TableName, BackupManifest> backupManifestMap, TableName[] sTableArray, TableName[] tTableArray, boolean isOverwrite) throws IOExceptionRestore operation. Stage 2: resolved Backup Image dependency- Parameters:
backupManifestMap
- : tableName, ManifestsTableArray
- The array of tables to be restoredtTableArray
- The array of mapping tables to restore to- Throws:
IOException
- exception
-
getTsFromBackupId
-
withinRange
-
execute
- Throws:
IOException
-