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,
boolean resetTtl,
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) |
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) |
void |
testExportFileSystemStateWithSkipTmp() |
void |
testExportWithResetTtl() |
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,
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) |
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(org.apache.hadoop.hbase.TableName tableName) 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
public void testExportWithResetTtl() 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 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
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 srcDir, org.apache.hadoop.fs.Path rawTgtDir, boolean overwrite, boolean resetTtl, TestExportSnapshot.RegionPredicate bypassregionPredicate, boolean success) 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 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
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()
static org.apache.hadoop.fs.Path getLocalDestinationDir(HBaseTestingUtility htu)
private static void removeExportDir(org.apache.hadoop.fs.Path path) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.