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
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.Admin
static final HBaseClassTestRule
private String
protected static final byte[]
private static final org.slf4j.Logger
private String
protected org.apache.hadoop.hbase.TableName
private int
protected static final HBaseTestingUtil
final org.junit.rules.TestName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
createTable
(org.apache.hadoop.hbase.TableName tableName) protected TestExportSnapshot.RegionPredicate
private org.apache.hadoop.fs.Path
(package private) static org.apache.hadoop.fs.Path
listFiles
(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path root, org.apache.hadoop.fs.Path dir) private static void
removeExportDir
(org.apache.hadoop.fs.Path path) private static int
runExportSnapshot
(org.apache.hadoop.conf.Configuration conf, String sourceSnapshotName, String targetSnapshotName, org.apache.hadoop.fs.Path srcDir, org.apache.hadoop.fs.Path rawTgtDir, boolean overwrite, boolean resetTtl, boolean checksumVerify, boolean noSourceVerify, boolean noTargetVerify) void
setUp()
Create a table and take a snapshot of the table used by the export test.static void
setUpBaseConf
(org.apache.hadoop.conf.Configuration conf) static void
void
tearDown()
static void
void
void
void
void
Verify if exported snapshot and copied files matches the original one.protected static void
testExportFileSystemState
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName tableName, String snapshotName, String targetName, int filesExpected, org.apache.hadoop.fs.Path srcDir, org.apache.hadoop.fs.Path rawTgtDir, boolean overwrite, boolean resetTtl, TestExportSnapshot.RegionPredicate bypassregionPredicate, boolean success, boolean checksumVerify) Creates destination directory, runs ExportSnapshot() tool, and runs some verifications.private void
testExportFileSystemState
(org.apache.hadoop.hbase.TableName tableName, String snapshotName, String targetName, int filesExpected) protected void
testExportFileSystemState
(org.apache.hadoop.hbase.TableName tableName, String snapshotName, String targetName, int filesExpected, org.apache.hadoop.fs.Path copyDir, boolean overwrite) protected void
testExportFileSystemState
(org.apache.hadoop.hbase.TableName tableName, String snapshotName, String targetName, int filesExpected, org.apache.hadoop.fs.Path copyDir, boolean overwrite, boolean resetTtl) void
void
void
void
void
void
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) 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)
-
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
-
testExportFileSystemStateWithSplitRegion
- Throws:
Exception
-
testExportFileSystemStateWithSkipTmp
- Throws:
Exception
-
testEmptyExportFileSystemState
- Throws:
Exception
-
testConsecutiveExports
- Throws:
Exception
-
testExportWithChecksum
- Throws:
Exception
-
testExportWithTargetName
- Throws:
Exception
-
testExportWithResetTtl
- Throws:
Exception
-
testExportExpiredSnapshot
- Throws:
Exception
-
testExportFileSystemState
private void testExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, String snapshotName, String targetName, int filesExpected) throws Exception - Throws:
Exception
-
testExportFileSystemState
protected void testExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, String snapshotName, String 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, String snapshotName, String 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, String snapshotName, String targetName, int filesExpected, org.apache.hadoop.fs.Path srcDir, org.apache.hadoop.fs.Path rawTgtDir, boolean overwrite, boolean resetTtl, TestExportSnapshot.RegionPredicate bypassregionPredicate, boolean success, boolean checksumVerify) 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
-
runExportSnapshot
private static int runExportSnapshot(org.apache.hadoop.conf.Configuration conf, String sourceSnapshotName, String targetSnapshotName, org.apache.hadoop.fs.Path srcDir, org.apache.hadoop.fs.Path rawTgtDir, boolean overwrite, boolean resetTtl, boolean checksumVerify, boolean noSourceVerify, boolean noTargetVerify) throws Exception - Throws:
Exception
-