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
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.Adminstatic final HBaseClassTestRuleprivate static final intprivate org.apache.hadoop.hbase.TableNameprivate intprivate org.apache.hadoop.fs.FileSystemprivate static final org.slf4j.Loggerprotected static final intprivate org.apache.hadoop.hbase.client.Tableprivate org.apache.hadoop.hbase.TableNameprivate org.apache.hadoop.fs.Path(package private) byte[](package private) Stringprivate static final Stringprotected static final byte[]private static final Stringorg.junit.rules.TestNameprotected static final HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprotected intcountRows(org.apache.hadoop.hbase.client.Table table, byte[]... families) private voidcreateAndCloneSnapshot(boolean online) Takes the snapshot of originalTable and clones the snapshot to another tables.protected org.apache.hadoop.hbase.client.TablecreateTable(org.apache.hadoop.hbase.TableName table, byte[] family) voidloadData(org.apache.hadoop.hbase.client.Table table, byte[]... families) private voidDo a split, and verify that this only affects one tableprivate voidVerify that adding data to original table or clone table doesn't affect other table.private voidVerify that deleting the snapshot does not affect either table.private voidAdd metadata, and verify that this only affects one tablevoidsetup()static voidSetup the config for the cluster and start it(package private) static voidsetupConf(org.apache.hadoop.conf.Configuration conf) voidtearDown()voidVerify that adding data to the cloned table will not affect the original, and vice-versa when it is taken as an offline snapshot.voidvoidVerify that adding netadata to the cloned table will not affect the original, and vice-versa when is taken as an online snapshot.voidVerify that region operations, in this case splitting a region, are independent between the cloned table and the original.voidVerify that adding data to the cloned table will not affect the original, and vice-versa when it is taken as an online snapshot.voidvoidVerify that adding metadata to the cloned table will not affect the original, and vice-versa when it is taken as an online snapshot.voidVerify that region operations, in this case splitting a region, are independent between the cloned table and the original.private static voidwaitOnSplit(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. Ifonlineis 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
-