@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,
HBaseProtos.SnapshotDescription snapshotDescription,
org.apache.hadoop.fs.Path snapshotDir,
HTableDescriptor tableDescriptor,
org.apache.hadoop.fs.Path rootDir,
ForeignExceptionDispatcher monitor,
MonitoredTask status) |
Modifier and Type | Method and Description |
---|---|
HRegionInfo |
cloneRegionInfo(HRegionInfo snapshotRegionInfo)
Create a new
HRegionInfo from the snapshot region info. |
static HTableDescriptor |
cloneTableSchema(HTableDescriptor snapshotTableDescriptor,
TableName tableName)
Create a new table descriptor cloning the snapshot table schema.
|
RestoreSnapshotHelper.RestoreMetaChanges |
restoreHdfsRegions()
Restore the on-disk table to a specified snapshot state.
|
public RestoreSnapshotHelper(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, HBaseProtos.SnapshotDescription snapshotDescription, org.apache.hadoop.fs.Path snapshotDir, HTableDescriptor tableDescriptor, org.apache.hadoop.fs.Path rootDir, ForeignExceptionDispatcher monitor, MonitoredTask status)
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 HTableDescriptor cloneTableSchema(HTableDescriptor snapshotTableDescriptor, TableName tableName) throws IOException
snapshotTableDescriptor
- tableName
- IOException
Copyright © 2013 The Apache Software Foundation. All rights reserved.