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
FieldsModifier and TypeFieldDescriptionprotected org.apache.hadoop.fs.Pathstatic final HBaseClassTestRuleprotected org.apache.hadoop.conf.Configurationprotected org.apache.hadoop.fs.FileSystemprivate static final org.slf4j.Loggerprotected org.apache.hadoop.fs.Pathprotected static final Stringprotected static final HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckNoHFileLinkInTableDir(org.apache.hadoop.hbase.TableName tableName) protected SnapshotTestingUtils.SnapshotMockprotected voidcreateTableAndSnapshot(org.apache.hadoop.hbase.TableName tableName, String snapshotName) private org.apache.hadoop.fs.PathgetReferredToFile(String referenceName) private org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelpergetRestoreHelper(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 booleanhasHFileLink(org.apache.hadoop.fs.Path tableDir) private voidrestoreAndVerify(String snapshotName, String tableName) voidsetup()static voidprotected voidsetupConf(org.apache.hadoop.conf.Configuration conf) voidtearDown()static voidvoidvoidprivate voidtestRestore(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 operationvoidvoidprivate voidverifyRestore(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
-