@InterfaceAudience.Private public class RestoreTablesClient extends Object
Modifier and Type | Field and Description |
---|---|
private String |
backupId |
private String |
backupRootDir |
private org.apache.hadoop.conf.Configuration |
conf |
private Connection |
conn |
private boolean |
isOverwrite |
private static org.slf4j.Logger |
LOG |
private org.apache.hadoop.fs.Path |
restoreRootDir |
private TableName[] |
sTableArray |
private TableName[] |
tTableArray |
Constructor and Description |
---|
RestoreTablesClient(Connection conn,
RestoreRequest request) |
Modifier and Type | Method and Description |
---|---|
private 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) |
private static final org.slf4j.Logger LOG
private org.apache.hadoop.conf.Configuration conf
private Connection conn
private TableName[] sTableArray
private TableName[] tTableArray
private String backupRootDir
private org.apache.hadoop.fs.Path restoreRootDir
private boolean isOverwrite
public RestoreTablesClient(Connection conn, RestoreRequest request) throws IOException
IOException
private void checkTargetTables(TableName[] tTableArray, boolean isOverwrite) throws IOException
tTableArray
- target tablesisOverwrite
- overwrite existing tableIOException
- exceptionprivate void restoreImages(BackupManifest.BackupImage[] images, TableName sTable, TableName tTable, boolean truncateIfExists) throws IOException
images
- array BackupImagesTable
- table to be restoredtTable
- table to be restored totruncateIfExists
- truncate tableIOException
- exceptionprivate List<org.apache.hadoop.fs.Path> getFilesRecursively(String fileBackupDir) throws IllegalArgumentException, IOException
IllegalArgumentException
IOException
private void restore(HashMap<TableName,BackupManifest> backupManifestMap, TableName[] sTableArray, TableName[] tTableArray, boolean isOverwrite) throws IOException
backupManifestMap
- : tableName, ManifestsTableArray
- The array of tables to be restoredtTableArray
- The array of mapping tables to restore toIOException
- exceptionstatic long getTsFromBackupId(String backupId)
static boolean withinRange(long a, long lower, long upper)
public void execute() throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.