Package org.apache.hadoop.hbase.client
Class TestSnapshotCloneIndependence
java.lang.Object
org.apache.hadoop.hbase.client.TestSnapshotCloneIndependence
- Direct Known Subclasses:
TestMobSnapshotCloneIndependence
Test to verify that the cloned table is independent of the table from which it was cloned
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.Admin
static final HBaseClassTestRule
private static final int
private org.apache.hadoop.hbase.TableName
private int
private org.apache.hadoop.fs.FileSystem
private static final org.slf4j.Logger
protected static final int
private org.apache.hadoop.hbase.client.Table
private org.apache.hadoop.hbase.TableName
private org.apache.hadoop.fs.Path
(package private) byte[]
(package private) String
private static final String
protected static final byte[]
private static final String
org.junit.rules.TestName
protected static final HBaseTestingUtility
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
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
Do a split, and verify that this only affects one tableprivate void
Verify that adding data to original table or clone table doesn't affect other table.private void
Verify that deleting the snapshot does not affect either table.private void
Add metadata, and verify that this only affects one tablevoid
setup()
static void
Setup the config for the cluster and start it(package private) static void
setupConf
(org.apache.hadoop.conf.Configuration conf) void
tearDown()
void
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
void
Verify that adding netadata to the cloned table will not affect the original, and vice-versa when is taken as an online snapshot.void
Verify that region operations, in this case splitting a region, are independent between the cloned table and the original.void
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
void
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
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)
-
Field Details
-
CLASS_RULE
-
LOG
-
testName
-
UTIL
-
NUM_RS
- See Also:
-
STRING_TABLE_NAME
- See Also:
-
TEST_FAM_STR
- See Also:
-
TEST_FAM
-
CLEANER_INTERVAL
- See Also:
-
fs
-
rootDir
-
admin
-
originalTableName
-
originalTable
-
cloneTableName
-
countOriginalTable
-
snapshotNameAsString
-
snapshotName
byte[] snapshotName
-
-
Constructor Details
-
TestSnapshotCloneIndependence
public TestSnapshotCloneIndependence()
-
-
Method Details
-
setupCluster
Setup the config for the cluster and start it- Throws:
Exception
-
setupConf
-
setup
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
cleanupTest
- Throws:
Exception
-
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.- Throws:
Exception
-
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.- Throws:
Exception
-
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.- Throws:
Exception
-
testOfflineSnapshotMetadataChangesIndependent
Verify that adding netadata to the cloned table will not affect the original, and vice-versa when is taken as an online snapshot.- Throws:
Exception
-
testOfflineSnapshotRegionOperationsIndependent
Verify that region operations, in this case splitting a region, are independent between the cloned table and the original.- Throws:
Exception
-
testOnlineSnapshotRegionOperationsIndependent
Verify that region operations, in this case splitting a region, are independent between the cloned table and the original.- Throws:
Exception
-
testOfflineSnapshotDeleteIndependent
- Throws:
Exception
-
testOnlineSnapshotDeleteIndependent
- Throws:
Exception
-
waitOnSplit
private static void waitOnSplit(org.apache.hadoop.hbase.client.Connection c, org.apache.hadoop.hbase.client.Table t, int originalCount) throws Exception - Throws:
Exception
-
createAndCloneSnapshot
Takes the snapshot of originalTable and clones the snapshot to another tables. Ifonline
is false, the original table is disabled during taking snapshot, so also enables it again.- Parameters:
online
- - Whether the table is online or not during the snapshot- Throws:
Exception
-
runTestSnapshotAppendIndependent
Verify that adding data to original table or clone table doesn't affect other table.- Throws:
Exception
-
runTestRegionOperationsIndependent
Do a split, and verify that this only affects one table- Throws:
Exception
-
runTestSnapshotMetadataChangesIndependent
Add metadata, and verify that this only affects one table- Throws:
Exception
-
runTestSnapshotDeleteIndependent
Verify that deleting the snapshot does not affect either table.- Throws:
Exception
-
createTable
protected org.apache.hadoop.hbase.client.Table createTable(org.apache.hadoop.hbase.TableName table, byte[] family) throws Exception - Throws:
Exception
-
loadData
public void loadData(org.apache.hadoop.hbase.client.Table table, byte[]... families) throws Exception - Throws:
Exception
-
countRows
protected int countRows(org.apache.hadoop.hbase.client.Table table, byte[]... families) throws Exception - Throws:
Exception
-