@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,
HTableDescriptor 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,
HTableDescriptor tableDescriptor,
org.apache.hadoop.fs.Path rootDir,
ForeignExceptionDispatcher monitor,
MonitoredTask status,
boolean createBackRefs) |
Modifier and Type | Method and Description |
---|---|
HRegionInfo |
cloneRegionInfo(HRegionInfo snapshotRegionInfo)
Create a new
HRegionInfo from the snapshot region info. |
static HRegionInfo |
cloneRegionInfo(TableName tableName,
HRegionInfo 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.protobuf.generated.HBaseProtos.SnapshotDescription snapshot,
TableName newTableName,
org.apache.hadoop.conf.Configuration conf) |
public RestoreSnapshotHelper(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotManifest manifest, HTableDescriptor 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, HTableDescriptor tableDescriptor, org.apache.hadoop.fs.Path rootDir, ForeignExceptionDispatcher monitor, MonitoredTask status, boolean createBackRefs)
public RestoreSnapshotHelper.RestoreMetaChanges restoreHdfsRegions() throws IOException
IOException
public HRegionInfo cloneRegionInfo(HRegionInfo snapshotRegionInfo)
HRegionInfo
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 HRegionInfo cloneRegionInfo(TableName tableName, HRegionInfo 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
- IOException
public static void restoreSnapshotACL(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot, TableName newTableName, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.