@InterfaceAudience.Private public class RestoreSnapshotHelper extends Object
The helper assumes that a table is already created, and by calling restore() the content present in the snapshot will be restored as the new content of the table.
Clone from Snapshot: If the target table is empty, the restore operation is just a "clone operation", where the only operations are:
Restore from Snapshot:
| Modifier and Type | Class and Description |
|---|---|
static class |
RestoreSnapshotHelper.RestoreMetaChanges
Describe the set of operations needed to update hbase:meta after restore.
|
| Constructor and Description |
|---|
RestoreSnapshotHelper(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
SnapshotManifest manifest,
org.apache.hadoop.hbase.client.TableDescriptor tableDescriptor,
org.apache.hadoop.fs.Path rootDir,
ForeignExceptionDispatcher monitor,
MonitoredTask status) |
RestoreSnapshotHelper(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
SnapshotManifest manifest,
org.apache.hadoop.hbase.client.TableDescriptor tableDescriptor,
org.apache.hadoop.fs.Path rootDir,
ForeignExceptionDispatcher monitor,
MonitoredTask status,
boolean createBackRefs) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.hbase.client.RegionInfo |
cloneRegionInfo(org.apache.hadoop.hbase.client.RegionInfo snapshotRegionInfo)
Create a new
RegionInfo from the snapshot region info. |
static org.apache.hadoop.hbase.client.RegionInfo |
cloneRegionInfo(org.apache.hadoop.hbase.TableName tableName,
org.apache.hadoop.hbase.client.RegionInfo snapshotRegionInfo) |
static RestoreSnapshotHelper.RestoreMetaChanges |
copySnapshotForScanner(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.fs.Path restoreDir,
String snapshotName)
Copy the snapshot files for a snapshot scanner, discards meta changes.
|
RestoreSnapshotHelper.RestoreMetaChanges |
restoreHdfsRegions()
Restore the on-disk table to a specified snapshot state.
|
static void |
restoreSnapshotAcl(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot,
org.apache.hadoop.hbase.TableName newTableName,
org.apache.hadoop.conf.Configuration conf) |
public RestoreSnapshotHelper(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
SnapshotManifest manifest,
org.apache.hadoop.hbase.client.TableDescriptor tableDescriptor,
org.apache.hadoop.fs.Path rootDir,
ForeignExceptionDispatcher monitor,
MonitoredTask status)
public RestoreSnapshotHelper(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
SnapshotManifest manifest,
org.apache.hadoop.hbase.client.TableDescriptor tableDescriptor,
org.apache.hadoop.fs.Path rootDir,
ForeignExceptionDispatcher monitor,
MonitoredTask status,
boolean createBackRefs)
public RestoreSnapshotHelper.RestoreMetaChanges restoreHdfsRegions() throws IOException
IOExceptionpublic org.apache.hadoop.hbase.client.RegionInfo cloneRegionInfo(org.apache.hadoop.hbase.client.RegionInfo snapshotRegionInfo)
RegionInfo from the snapshot region info.
Keep the same startKey, endKey, regionId and split information but change
the table name.snapshotRegionInfo - Info for region to clone.public static org.apache.hadoop.hbase.client.RegionInfo cloneRegionInfo(org.apache.hadoop.hbase.TableName tableName,
org.apache.hadoop.hbase.client.RegionInfo snapshotRegionInfo)
public static RestoreSnapshotHelper.RestoreMetaChanges copySnapshotForScanner(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path restoreDir, String snapshotName) throws IOException
conf - fs - rootDir - restoreDir - snapshotName - IOExceptionpublic static void restoreSnapshotAcl(org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot,
org.apache.hadoop.hbase.TableName newTableName,
org.apache.hadoop.conf.Configuration conf)
throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.