public class TestSnapshotCloneIndependence extends Object
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.hbase.client.Admin |
admin |
static HBaseClassTestRule |
CLASS_RULE |
private static int |
CLEANER_INTERVAL |
private org.apache.hadoop.hbase.TableName |
cloneTableName |
private int |
countOriginalTable |
private org.apache.hadoop.fs.FileSystem |
fs |
private static org.slf4j.Logger |
LOG |
protected static int |
NUM_RS |
private org.apache.hadoop.hbase.client.Table |
originalTable |
private org.apache.hadoop.hbase.TableName |
originalTableName |
private org.apache.hadoop.fs.Path |
rootDir |
(package private) byte[] |
snapshotName |
(package private) String |
snapshotNameAsString |
private static String |
STRING_TABLE_NAME |
protected static byte[] |
TEST_FAM |
private static String |
TEST_FAM_STR |
org.junit.rules.TestName |
testName |
protected static HBaseTestingUtility |
UTIL |
Constructor and Description |
---|
TestSnapshotCloneIndependence() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanupTest() |
protected int |
countRows(org.apache.hadoop.hbase.client.Table table,
byte[]... families) |
private void |
createAndCloneSnapshot(boolean online)
Takes the snapshot of originalTable and clones the snapshot to another tables.
|
protected org.apache.hadoop.hbase.client.Table |
createTable(org.apache.hadoop.hbase.TableName table,
byte[] family) |
void |
loadData(org.apache.hadoop.hbase.client.Table table,
byte[]... families) |
private void |
runTestRegionOperationsIndependent()
Do a split, and verify that this only affects one table
|
private void |
runTestSnapshotAppendIndependent()
Verify that adding data to original table or clone table doesn't affect other table.
|
private void |
runTestSnapshotDeleteIndependent()
Verify that deleting the snapshot does not affect either table.
|
private void |
runTestSnapshotMetadataChangesIndependent()
Add metadata, and verify that this only affects one table
|
void |
setup() |
static void |
setupCluster()
Setup the config for the cluster and start it
|
(package private) static void |
setupConf(org.apache.hadoop.conf.Configuration conf) |
void |
tearDown() |
void |
testOfflineSnapshotAppendIndependent()
Verify that adding data to the cloned table will not affect the original, and vice-versa when
it is taken as an offline snapshot.
|
void |
testOfflineSnapshotDeleteIndependent() |
void |
testOfflineSnapshotMetadataChangesIndependent()
Verify that adding netadata to the cloned table will not affect the original, and vice-versa
when is taken as an online snapshot.
|
void |
testOfflineSnapshotRegionOperationsIndependent()
Verify that region operations, in this case splitting a region, are independent between the
cloned table and the original.
|
void |
testOnlineSnapshotAppendIndependent()
Verify that adding data to the cloned table will not affect the original, and vice-versa when
it is taken as an online snapshot.
|
void |
testOnlineSnapshotDeleteIndependent() |
void |
testOnlineSnapshotMetadataChangesIndependent()
Verify that adding metadata to the cloned table will not affect the original, and vice-versa
when it is taken as an online snapshot.
|
void |
testOnlineSnapshotRegionOperationsIndependent()
Verify that region operations, in this case splitting a region, are independent between the
cloned table and the original.
|
private static void |
waitOnSplit(org.apache.hadoop.hbase.client.Connection c,
org.apache.hadoop.hbase.client.Table t,
int originalCount) |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
public org.junit.rules.TestName testName
protected static final HBaseTestingUtility UTIL
protected static final int NUM_RS
private static final String STRING_TABLE_NAME
private static final String TEST_FAM_STR
protected static final byte[] TEST_FAM
private static final int CLEANER_INTERVAL
private org.apache.hadoop.fs.FileSystem fs
private org.apache.hadoop.fs.Path rootDir
private org.apache.hadoop.hbase.client.Admin admin
private org.apache.hadoop.hbase.TableName originalTableName
private org.apache.hadoop.hbase.client.Table originalTable
private org.apache.hadoop.hbase.TableName cloneTableName
private int countOriginalTable
String snapshotNameAsString
byte[] snapshotName
public TestSnapshotCloneIndependence()
public static void setupCluster() throws Exception
Exception
static void setupConf(org.apache.hadoop.conf.Configuration conf)
public static void cleanupTest() throws Exception
Exception
public void testOnlineSnapshotAppendIndependent() throws Exception
Exception
public void testOfflineSnapshotAppendIndependent() throws Exception
Exception
public void testOnlineSnapshotMetadataChangesIndependent() throws Exception
Exception
public void testOfflineSnapshotMetadataChangesIndependent() throws Exception
Exception
public void testOfflineSnapshotRegionOperationsIndependent() throws Exception
Exception
public void testOnlineSnapshotRegionOperationsIndependent() throws Exception
Exception
public void testOfflineSnapshotDeleteIndependent() throws Exception
Exception
public void testOnlineSnapshotDeleteIndependent() throws Exception
Exception
private static void waitOnSplit(org.apache.hadoop.hbase.client.Connection c, org.apache.hadoop.hbase.client.Table t, int originalCount) throws Exception
Exception
private void createAndCloneSnapshot(boolean online) throws Exception
online
is false, the original table is disabled during taking snapshot, so also
enables it again.online
- - Whether the table is online or not during the snapshotException
private void runTestSnapshotAppendIndependent() throws Exception
Exception
private void runTestRegionOperationsIndependent() throws Exception
Exception
private void runTestSnapshotMetadataChangesIndependent() throws Exception
Exception
private void runTestSnapshotDeleteIndependent() throws Exception
Exception
protected org.apache.hadoop.hbase.client.Table createTable(org.apache.hadoop.hbase.TableName table, byte[] family) throws Exception
Exception
public void loadData(org.apache.hadoop.hbase.client.Table table, byte[]... families) throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.