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(org.apache.hadoop.hbase.TableName tableName) |
protected TestExportSnapshot.RegionPredicate |
getBypassRegionPredicate() |
private org.apache.hadoop.fs.Path |
getHdfsDestinationDir() |
(package private) static org.apache.hadoop.fs.Path |
getLocalDestinationDir(HBaseTestingUtility htu) |
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 |
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 srcDir,
org.apache.hadoop.fs.Path rawTgtDir,
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 |
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 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
Exceptionpublic static void tearDownAfterClass() throws Exception
Exceptionpublic void setUp() throws Exception
Exceptionprotected void createTable(org.apache.hadoop.hbase.TableName tableName) 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
Exceptionprivate void testExportFileSystemState(org.apache.hadoop.hbase.TableName tableName, byte[] snapshotName, byte[] targetName, int filesExpected) throws Exception
Exceptionprotected void testExportFileSystemState(org.apache.hadoop.hbase.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, 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, TestExportSnapshot.RegionPredicate bypassregionPredicate, boolean success) 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 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
IOExceptionprivate static Set<String> listFiles(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path root, org.apache.hadoop.fs.Path dir) throws IOException
IOExceptionprivate org.apache.hadoop.fs.Path getHdfsDestinationDir()
static org.apache.hadoop.fs.Path getLocalDestinationDir(HBaseTestingUtility htu)
private static void removeExportDir(org.apache.hadoop.fs.Path path) throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.