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 SummaryFieldsModifier 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) String(package private) Stringprotected static final byte[]private static final Stringorg.junit.rules.TestNameprotected static final HBaseTestingUtil
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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:
 
- 
TEST_FAM_STR- See Also:
 
- 
TEST_FAM
- 
CLEANER_INTERVAL- See Also:
 
- 
fs
- 
rootDir
- 
admin
- 
originalTableName
- 
originalTable
- 
cloneTableName
- 
countOriginalTable
- 
snapshotNameAsString
- 
snapshotName
 
- 
- 
Constructor Details- 
TestSnapshotCloneIndependencepublic TestSnapshotCloneIndependence()
 
- 
- 
Method Details- 
setupClusterSetup the config for the cluster and start it- Throws:
- Exception
 
- 
setupConf
- 
setup- Throws:
- Exception
 
- 
tearDown- Throws:
- Exception
 
- 
cleanupTest- Throws:
- Exception
 
- 
testOnlineSnapshotAppendIndependentVerify 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
 
- 
testOfflineSnapshotAppendIndependentVerify 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
 
- 
testOnlineSnapshotMetadataChangesIndependentVerify 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
 
- 
testOfflineSnapshotMetadataChangesIndependentVerify that adding netadata to the cloned table will not affect the original, and vice-versa when is taken as an online snapshot.- Throws:
- Exception
 
- 
testOfflineSnapshotRegionOperationsIndependentVerify that region operations, in this case splitting a region, are independent between the cloned table and the original.- Throws:
- Exception
 
- 
testOnlineSnapshotRegionOperationsIndependentVerify 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
 
- 
waitOnSplitprivate static void waitOnSplit(org.apache.hadoop.hbase.client.Connection c, org.apache.hadoop.hbase.client.Table t, int originalCount) throws Exception - Throws:
- Exception
 
- 
createAndCloneSnapshotTakes 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
 
- 
runTestSnapshotAppendIndependentVerify that adding data to original table or clone table doesn't affect other table.- Throws:
- Exception
 
- 
runTestRegionOperationsIndependentDo a split, and verify that this only affects one table- Throws:
- Exception
 
- 
runTestSnapshotMetadataChangesIndependentAdd metadata, and verify that this only affects one table- Throws:
- Exception
 
- 
runTestSnapshotDeleteIndependentVerify that deleting the snapshot does not affect either table.- Throws:
- Exception
 
- 
createTableprotected org.apache.hadoop.hbase.client.Table createTable(org.apache.hadoop.hbase.TableName table, byte[] family) throws Exception - Throws:
- Exception
 
- 
loadDatapublic void loadData(org.apache.hadoop.hbase.client.Table table, byte[]... families) throws Exception - Throws:
- Exception
 
- 
countRowsprotected int countRows(org.apache.hadoop.hbase.client.Table table, byte[]... families) throws Exception - Throws:
- Exception
 
 
-