public class TestExportSnapshot extends Object
Modifier and Type | Class and Description |
---|---|
protected static interface |
TestExportSnapshot.RegionPredicate |
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.hbase.client.Admin |
admin |
static HBaseClassTestRule |
CLASS_RULE |
private byte[] |
emptySnapshotName |
protected static byte[] |
FAMILY |
private static org.slf4j.Logger |
LOG |
private byte[] |
snapshotName |
protected org.apache.hadoop.hbase.TableName |
tableName |
private int |
tableNumFiles |
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() |
private org.apache.hadoop.fs.Path |
getHdfsDestinationDir() |
private org.apache.hadoop.fs.Path |
getLocalDestinationDir() |
private static Set<String> |
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) |
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,
org.apache.hadoop.hbase.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.
|
private void |
testExportFileSystemState(org.apache.hadoop.hbase.TableName tableName,
byte[] snapshotName,
byte[] targetName,
int filesExpected) |
protected void |
testExportFileSystemState(org.apache.hadoop.hbase.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,
org.apache.hadoop.hbase.TableName tableName,
String snapshotName,
TestExportSnapshot.RegionPredicate bypassregionPredicate) |
protected Set<String> |
verifySnapshot(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.hbase.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
private static final org.slf4j.Logger LOG
protected static final HBaseTestingUtility TEST_UTIL
protected static final byte[] FAMILY
public final org.junit.rules.TestName testName
protected org.apache.hadoop.hbase.TableName tableName
private byte[] emptySnapshotName
private byte[] snapshotName
private int tableNumFiles
private org.apache.hadoop.hbase.client.Admin admin
public TestExportSnapshot()
public static void setUpBaseConf(org.apache.hadoop.conf.Configuration conf)
public static void setUpBeforeClass() throws Exception
Exception
public static void tearDownAfterClass() throws Exception
Exception
public void setUp() throws Exception
Exception
protected void createTable() throws Exception
Exception
protected TestExportSnapshot.RegionPredicate getBypassRegionPredicate()
public void testExportFileSystemState() throws Exception
Exception
public void testExportFileSystemStateWithSkipTmp() throws Exception
Exception
public void testEmptyExportFileSystemState() throws Exception
Exception
public void testConsecutiveExports() throws Exception
Exception
public void testExportWithTargetName() throws Exception
Exception
private void testExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected) throws Exception
Exception
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
Exception
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 sourceDir, org.apache.hadoop.fs.Path copyDir, boolean overwrite, TestExportSnapshot.RegionPredicate bypassregionPredicate, boolean success) throws Exception
Exception
public void testExportRetry() throws Exception
Exception
public void testExportFailure() throws Exception
Exception
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
IOException
protected Set<String> verifySnapshot(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.TableName tableName, String snapshotName) throws IOException
IOException
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, TestExportSnapshot.RegionPredicate bypassregionPredicate) throws IOException
IOException
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
IOException
private org.apache.hadoop.fs.Path getHdfsDestinationDir()
private org.apache.hadoop.fs.Path getLocalDestinationDir()
private static void removeExportDir(org.apache.hadoop.fs.Path path) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.