|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper
@InterfaceAudience.Private public class RestoreSnapshotHelper
Helper to Restore/Clone a Snapshot
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:
Nested Class Summary | |
---|---|
static class |
RestoreSnapshotHelper.RestoreMetaChanges
Describe the set of operations needed to update META after restore. |
Constructor Summary | |
---|---|
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 tableDir,
ForeignExceptionDispatcher monitor,
MonitoredTask status)
|
Method Summary | |
---|---|
HRegionInfo |
cloneRegionInfo(HRegionInfo snapshotRegionInfo)
Create a new HRegionInfo from the snapshot region info. |
static HTableDescriptor |
cloneTableSchema(HTableDescriptor snapshotTableDescriptor,
byte[] tableName)
Create a new table descriptor cloning the snapshot table schema. |
RestoreSnapshotHelper.RestoreMetaChanges |
restoreHdfsRegions()
Restore the on-disk table to a specified snapshot state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 tableDir, ForeignExceptionDispatcher monitor, MonitoredTask status)
Method Detail |
---|
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, byte[] tableName) throws IOException
snapshotTableDescriptor
- tableName
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |