Package org.apache.hadoop.hbase.snapshot
Class TestExportSnapshot
java.lang.Object
org.apache.hadoop.hbase.snapshot.TestExportSnapshot
- Direct Known Subclasses:
TestExportSnapshotWithTemporaryDirectory,TestMobExportSnapshot,TestSecureExportSnapshot
Test Export Snapshot Tool
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.Adminstatic final HBaseClassTestRuleprivate byte[]protected static final byte[]private static final org.slf4j.Loggerprivate byte[]protected org.apache.hadoop.hbase.TableNameprivate intprotected static final HBaseTestingUtilityfinal org.junit.rules.TestName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateTable(org.apache.hadoop.hbase.TableName tableName) protected TestExportSnapshot.RegionPredicateprivate org.apache.hadoop.fs.Path(package private) static org.apache.hadoop.fs.PathlistFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path root, org.apache.hadoop.fs.Path dir) private static voidremoveExportDir(org.apache.hadoop.fs.Path path) voidsetUp()Create a table and take a snapshot of the table used by the export test.static voidsetUpBaseConf(org.apache.hadoop.conf.Configuration conf) static voidvoidtearDown()static voidvoidvoidvoidVerify if exported snapshot and copied files matches the original one.protected static voidtestExportFileSystemState(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected, org.apache.hadoop.fs.Path srcDir, org.apache.hadoop.fs.Path rawTgtDir, boolean overwrite, boolean resetTtl, TestExportSnapshot.RegionPredicate bypassregionPredicate, boolean success) Creates destination directory, runs ExportSnapshot() tool, and runs some verifications.private voidtestExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected) protected voidtestExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected, org.apache.hadoop.fs.Path copyDir, boolean overwrite) protected voidtestExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected, org.apache.hadoop.fs.Path copyDir, boolean overwrite, boolean resetTtl) voidvoidvoidvoidverifySnapshot(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.TableName tableName, String snapshotName, boolean resetTtl, TestExportSnapshot.RegionPredicate bypassregionPredicate) protected static voidverifySnapshotDir(org.apache.hadoop.fs.FileSystem fs1, org.apache.hadoop.fs.Path root1, org.apache.hadoop.fs.FileSystem fs2, org.apache.hadoop.fs.Path root2)
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
FAMILY
-
testName
-
tableName
-
emptySnapshotName
-
snapshotName
-
tableNumFiles
-
admin
-
-
Constructor Details
-
TestExportSnapshot
public TestExportSnapshot()
-
-
Method Details
-
setUpBaseConf
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
setUp
Create a table and take a snapshot of the table used by the export test.- Throws:
Exception
-
createTable
- Throws:
Exception
-
getBypassRegionPredicate
-
tearDown
- Throws:
Exception
-
testExportFileSystemState
Verify if exported snapshot and copied files matches the original one.- Throws:
Exception
-
testExportFileSystemStateWithMergeRegion
- Throws:
Exception
-
testExportFileSystemStateWithSkipTmp
- Throws:
Exception
-
testEmptyExportFileSystemState
- Throws:
Exception
-
testConsecutiveExports
- Throws:
Exception
-
testExportWithTargetName
- Throws:
Exception
-
testExportWithResetTtl
- Throws:
Exception
-
testExportFileSystemState
private void testExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected) throws Exception - Throws:
Exception
-
testExportFileSystemState
protected void testExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected, org.apache.hadoop.fs.Path copyDir, boolean overwrite) throws Exception - Throws:
Exception
-
testExportFileSystemState
protected void testExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected, org.apache.hadoop.fs.Path copyDir, boolean overwrite, boolean resetTtl) throws Exception - Throws:
Exception
-
testExportFileSystemState
protected static void testExportFileSystemState(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected, org.apache.hadoop.fs.Path srcDir, org.apache.hadoop.fs.Path rawTgtDir, boolean overwrite, boolean resetTtl, TestExportSnapshot.RegionPredicate bypassregionPredicate, boolean success) throws Exception Creates destination directory, runs ExportSnapshot() tool, and runs some verifications.- Throws:
Exception
-
verifySnapshotDir
protected static void verifySnapshotDir(org.apache.hadoop.fs.FileSystem fs1, org.apache.hadoop.fs.Path root1, org.apache.hadoop.fs.FileSystem fs2, org.apache.hadoop.fs.Path root2) throws IOException - Throws:
IOException
-
verifySnapshot
protected static Set<String> verifySnapshot(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.TableName tableName, String snapshotName, boolean resetTtl, TestExportSnapshot.RegionPredicate bypassregionPredicate) throws IOException - Throws:
IOException
-
listFiles
private static Set<String> listFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path root, org.apache.hadoop.fs.Path dir) throws IOException - Throws:
IOException
-
getHdfsDestinationDir
-
getLocalDestinationDir
-
removeExportDir
- Throws:
IOException
-