Class RestoreTablesClient
java.lang.Object
org.apache.hadoop.hbase.backup.impl.RestoreTablesClient
Restore table implementation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate org.apache.hadoop.conf.Configurationprivate Connectionprivate booleanprivate static final org.slf4j.Loggerprivate org.apache.hadoop.fs.Pathprivate TableName[]private TableName[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckTargetTables(TableName[] tTableArray, boolean isOverwrite) Validate target tables.voidexecute()private List<org.apache.hadoop.fs.Path>getFilesRecursively(String fileBackupDir) (package private) static longgetTsFromBackupId(String backupId) private voidrestore(HashMap<TableName, BackupManifest> backupManifestMap, TableName[] sTableArray, TableName[] tTableArray, boolean isOverwrite) Restore operation.private voidrestoreImages(BackupManifest.BackupImage[] images, TableName sTable, TableName tTable, boolean truncateIfExists) Restore operation handle each backupImage in array.(package private) static booleanwithinRange(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:
IllegalArgumentExceptionIOException
-
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
-