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
Exception
public static void tearDownCluster() throws Exception
Exception
protected SnapshotTestingUtils.SnapshotMock createSnapshotMock() throws IOException
IOException
public void testRestore() throws IOException
IOException
public void testRestoreWithNamespace() throws IOException
IOException
public void testNoHFileLinkInRootDir() throws IOException
IOException
public void testSkipReplayAndUpdateSeqId() throws Exception
Exception
protected void createTableAndSnapshot(org.apache.hadoop.hbase.TableName tableName, String snapshotName) throws IOException
IOException
private void checkNoHFileLinkInTableDir(org.apache.hadoop.hbase.TableName tableName) throws IOException
IOException
private boolean hasHFileLink(org.apache.hadoop.fs.Path tableDir) throws IOException
IOException
private void restoreAndVerify(String snapshotName, String tableName) throws IOException
IOException
private void verifyRestore(org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.hbase.client.TableDescriptor sourceHtd, org.apache.hadoop.hbase.client.TableDescriptor htdClone) throws IOException
IOException
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) throws IOException
snapshotDir
- The snapshot directory to use as "restore source"sd
- The snapshot descriptorhtdClone
- The HTableDescriptor of the table to restore/clone.IOException
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) throws IOException
IOException
private org.apache.hadoop.fs.Path getReferredToFile(String referenceName)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.