Package org.apache.hadoop.hbase.snapshot
Class TestRestoreSnapshotHelper
java.lang.Object
org.apache.hadoop.hbase.snapshot.TestRestoreSnapshotHelper
- Direct Known Subclasses:
TestMobRestoreSnapshotHelper
Test the restore/clone operation from a file-system point of view.
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.apache.hadoop.fs.Path
static final HBaseClassTestRule
protected org.apache.hadoop.conf.Configuration
protected org.apache.hadoop.fs.FileSystem
private static final org.slf4j.Logger
protected org.apache.hadoop.fs.Path
protected static final String
protected static final HBaseTestingUtility
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkNoHFileLinkInTableDir
(org.apache.hadoop.hbase.TableName tableName) protected SnapshotTestingUtils.SnapshotMock
protected void
createTableAndSnapshot
(org.apache.hadoop.hbase.TableName tableName, String snapshotName) private org.apache.hadoop.fs.Path
getReferredToFile
(String referenceName) private org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper
getRestoreHelper
(org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription sd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) Initialize the restore helper, based on the snapshot and table information provided.private boolean
hasHFileLink
(org.apache.hadoop.fs.Path tableDir) private void
restoreAndVerify
(String snapshotName, String tableName) void
setup()
static void
protected void
setupConf
(org.apache.hadoop.conf.Configuration conf) void
tearDown()
static void
void
void
private void
testRestore
(org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription sd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) Execute the restore operationvoid
void
private void
verifyRestore
(org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.client.TableDescriptor sourceHtd, org.apache.hadoop.hbase.client.TableDescriptor htdClone)
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
TEST_HFILE
- See Also:
-
conf
-
archiveDir
-
fs
-
rootDir
-
-
Constructor Details
-
TestRestoreSnapshotHelper
public TestRestoreSnapshotHelper()
-
-
Method Details
-
setupConf
-
setupCluster
- Throws:
Exception
-
tearDownCluster
- Throws:
Exception
-
setup
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
createSnapshotMock
- Throws:
IOException
-
testRestore
- Throws:
IOException
-
testRestoreWithNamespace
- Throws:
IOException
-
testNoHFileLinkInRootDir
- Throws:
IOException
-
testSkipReplayAndUpdateSeqId
- Throws:
Exception
-
createTableAndSnapshot
protected void createTableAndSnapshot(org.apache.hadoop.hbase.TableName tableName, String snapshotName) throws IOException - Throws:
IOException
-
checkNoHFileLinkInTableDir
private void checkNoHFileLinkInTableDir(org.apache.hadoop.hbase.TableName tableName) throws IOException - Throws:
IOException
-
hasHFileLink
- Throws:
IOException
-
restoreAndVerify
- Throws:
IOException
-
verifyRestore
private void verifyRestore(org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.client.TableDescriptor sourceHtd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) throws IOException - Throws:
IOException
-
testRestore
private void testRestore(org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription sd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) throws IOException Execute the restore operation- Parameters:
snapshotDir
- The snapshot directory to use as "restore source"sd
- The snapshot descriptorhtdClone
- The HTableDescriptor of the table to restore/clone.- Throws:
IOException
-
getRestoreHelper
private org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper getRestoreHelper(org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription sd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) throws IOException Initialize the restore helper, based on the snapshot and table information provided.- Throws:
IOException
-
getReferredToFile
-