public class TestRestoreSnapshotHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.fs.Path |
archiveDir |
static HBaseClassTestRule |
CLASS_RULE |
protected org.apache.hadoop.conf.Configuration |
conf |
protected org.apache.hadoop.fs.FileSystem |
fs |
private static org.slf4j.Logger |
LOG |
protected org.apache.hadoop.fs.Path |
rootDir |
protected static String |
TEST_HFILE |
protected static HBaseTestingUtility |
TEST_UTIL |
| Constructor and Description |
|---|
TestRestoreSnapshotHelper() |
| Modifier and Type | Method and Description |
|---|---|
private void |
checkNoHFileLinkInTableDir(org.apache.hadoop.hbase.TableName tableName) |
protected SnapshotTestingUtils.SnapshotMock |
createSnapshotMock() |
protected void |
createTableAndSnapshot(org.apache.hadoop.hbase.TableName tableName,
String snapshotName) |
private org.apache.hadoop.fs.Path |
getReferredToFile(String referenceName) |
private org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper |
getRestoreHelper(org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.fs.Path snapshotDir,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription sd,
org.apache.hadoop.hbase.client.TableDescriptor htdClone)
Initialize the restore helper, based on the snapshot and table information provided.
|
private boolean |
hasHFileLink(org.apache.hadoop.fs.Path tableDir) |
private void |
restoreAndVerify(String snapshotName,
String tableName) |
void |
setup() |
static void |
setupCluster() |
protected void |
setupConf(org.apache.hadoop.conf.Configuration conf) |
void |
tearDown() |
static void |
tearDownCluster() |
void |
testNoHFileLinkInRootDir() |
void |
testRestore() |
private void |
testRestore(org.apache.hadoop.fs.Path snapshotDir,
org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription sd,
org.apache.hadoop.hbase.client.TableDescriptor htdClone)
Execute the restore operation
|
void |
testRestoreWithNamespace() |
void |
testSkipReplayAndUpdateSeqId() |
private void |
verifyRestore(org.apache.hadoop.fs.Path rootDir,
org.apache.hadoop.hbase.client.TableDescriptor sourceHtd,
org.apache.hadoop.hbase.client.TableDescriptor htdClone) |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
protected static final HBaseTestingUtility TEST_UTIL
protected static final String TEST_HFILE
protected org.apache.hadoop.conf.Configuration conf
protected org.apache.hadoop.fs.Path archiveDir
protected org.apache.hadoop.fs.FileSystem fs
protected org.apache.hadoop.fs.Path rootDir
public TestRestoreSnapshotHelper()
protected void setupConf(org.apache.hadoop.conf.Configuration conf)
public static void setupCluster() throws Exception
Exceptionpublic static void tearDownCluster() throws Exception
Exceptionprotected SnapshotTestingUtils.SnapshotMock createSnapshotMock() throws IOException
IOExceptionpublic void testRestore() throws IOException
IOExceptionpublic void testRestoreWithNamespace() throws IOException
IOExceptionpublic void testNoHFileLinkInRootDir() throws IOException
IOExceptionpublic void testSkipReplayAndUpdateSeqId() throws Exception
Exceptionprotected void createTableAndSnapshot(org.apache.hadoop.hbase.TableName tableName, String snapshotName) throws IOException
IOExceptionprivate void checkNoHFileLinkInTableDir(org.apache.hadoop.hbase.TableName tableName) throws IOException
IOExceptionprivate boolean hasHFileLink(org.apache.hadoop.fs.Path tableDir) throws IOException
IOExceptionprivate void restoreAndVerify(String snapshotName, String tableName) throws IOException
IOExceptionprivate void verifyRestore(org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.client.TableDescriptor sourceHtd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) throws IOException
IOExceptionprivate void testRestore(org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription sd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) throws IOException
snapshotDir - The snapshot directory to use as "restore source"sd - The snapshot descriptorhtdClone - The HTableDescriptor of the table to restore/clone.IOExceptionprivate org.apache.hadoop.hbase.snapshot.RestoreSnapshotHelper getRestoreHelper(org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path snapshotDir, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription sd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) throws IOException
IOExceptionprivate org.apache.hadoop.fs.Path getReferredToFile(String referenceName)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.