public class TestExportSnapshot extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
TestExportSnapshot.RegionPredicate |
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
protected static byte[] |
FAMILY |
protected TableName |
tableName |
protected static HBaseTestingUtility |
TEST_UTIL |
org.junit.rules.TestName |
testName |
| Constructor and Description |
|---|
TestExportSnapshot() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createTable() |
protected TestExportSnapshot.RegionPredicate |
getBypassRegionPredicate() |
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 |
setUpBeforeClass() |
void |
tearDown() |
static void |
tearDownAfterClass() |
void |
testConsecutiveExports() |
void |
testEmptyExportFileSystemState() |
void |
testExportFailure()
Check that ExportSnapshot will fail if we inject failure more times than MR will retry.
|
void |
testExportFileSystemState()
Verify if exported snapshot and copied files matches the original one.
|
protected static void |
testExportFileSystemState(org.apache.hadoop.conf.Configuration conf,
TableName tableName,
byte[] snapshotName,
byte[] targetName,
int filesExpected,
org.apache.hadoop.fs.Path sourceDir,
org.apache.hadoop.fs.Path copyDir,
boolean overwrite,
TestExportSnapshot.RegionPredicate bypassregionPredicate,
boolean success)
Creates destination directory, runs ExportSnapshot() tool, and runs some verifications.
|
protected void |
testExportFileSystemState(TableName tableName,
byte[] snapshotName,
byte[] targetName,
int filesExpected,
org.apache.hadoop.fs.Path copyDir,
boolean overwrite) |
void |
testExportFileSystemStateWithSkipTmp() |
void |
testExportRetry()
Check that ExportSnapshot will succeed if something fails but the retry succeed.
|
void |
testExportWithTargetName() |
protected static Set<String> |
verifySnapshot(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
TableName tableName,
String snapshotName,
TestExportSnapshot.RegionPredicate bypassregionPredicate) |
protected Set<String> |
verifySnapshot(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
TableName tableName,
String snapshotName) |
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) |
public static final HBaseClassTestRule CLASS_RULE
protected static final HBaseTestingUtility TEST_UTIL
protected static final byte[] FAMILY
public final org.junit.rules.TestName testName
public TestExportSnapshot()
public static void setUpBaseConf(org.apache.hadoop.conf.Configuration conf)
public static void setUpBeforeClass() throws Exception
Exceptionpublic static void tearDownAfterClass() throws Exception
Exceptionpublic void setUp() throws Exception
Exceptionprotected void createTable() throws Exception
Exceptionprotected TestExportSnapshot.RegionPredicate getBypassRegionPredicate()
public void testExportFileSystemState() throws Exception
Exceptionpublic void testExportFileSystemStateWithSkipTmp() throws Exception
Exceptionpublic void testEmptyExportFileSystemState() throws Exception
Exceptionpublic void testConsecutiveExports() throws Exception
Exceptionpublic void testExportWithTargetName() throws Exception
Exceptionprotected void testExportFileSystemState(TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected, org.apache.hadoop.fs.Path copyDir, boolean overwrite) throws Exception
Exceptionprotected static void testExportFileSystemState(org.apache.hadoop.conf.Configuration conf, TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected, org.apache.hadoop.fs.Path sourceDir, org.apache.hadoop.fs.Path copyDir, boolean overwrite, TestExportSnapshot.RegionPredicate bypassregionPredicate, boolean success) throws Exception
Exceptionpublic void testExportRetry() throws Exception
Exceptionpublic void testExportFailure() throws Exception
Exceptionprotected 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
IOExceptionprotected Set<String> verifySnapshot(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, TableName tableName, String snapshotName) throws IOException
IOExceptionprotected static Set<String> verifySnapshot(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, TableName tableName, String snapshotName, TestExportSnapshot.RegionPredicate bypassregionPredicate) throws IOException
IOExceptionCopyright © 2007–2019 Cloudera. All rights reserved.