Package org.apache.hadoop.hbase.snapshot
Class TestFlushSnapshotFromClient
java.lang.Object
org.apache.hadoop.hbase.snapshot.TestFlushSnapshotFromClient
- Direct Known Subclasses:
TestConcurrentFlushSnapshotFromClient,TestMobFlushSnapshotFromClient
Test creating/using/deleting snapshots from the client
This is an end-to-end test for the snapshot utility TODO This is essentially a clone of TestSnapshotFromClient. This is worth refactoring this because there will be a few more flavors of snapshots that need to run these tests.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.hadoop.hbase.client.Adminstatic final HBaseClassTestRuleprotected final intprivate static final org.slf4j.Loggerprotected static final intprotected static final org.apache.hadoop.hbase.TableNameprotected static final byte[]protected static final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprotected intcountRows(org.apache.hadoop.hbase.client.Table table, byte[]... families) protected voidvoidsetup()static voidprotected static voidsetupConf(org.apache.hadoop.conf.Configuration conf) voidtearDown()voidvoidBasic end-to-end test of simple-flush-based snapshotsvoidTest simple flush snapshotting a table that is onlinevoidTest simple flush snapshotting a table that is onlinevoidTest snapshotting a table that is online without flushingvoidvoidvoidprotected voidverifyRowCount(HBaseTestingUtil util, org.apache.hadoop.hbase.TableName tableName, long expectedRows) private static voidwaitForSnapshotToComplete(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, long timeoutNanos) Helper method for testing async snapshot operations.private voidwaitRegionsAfterMerge(long numRegionsAfterMerge)
-
Field Details
-
CLASS_RULE
-
LOG
-
UTIL
-
NUM_RS
- See Also:
-
TEST_FAM
-
TABLE_NAME
-
DEFAULT_NUM_ROWS
- See Also:
-
admin
-
-
Constructor Details
-
TestFlushSnapshotFromClient
public TestFlushSnapshotFromClient()
-
-
Method Details
-
setupCluster
- Throws:
Exception
-
setupConf
-
setup
- Throws:
Exception
-
createTable
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
cleanupTest
- Throws:
Exception
-
testFlushTableSnapshot
Test simple flush snapshotting a table that is online- Throws:
Exception
-
testSkipFlushTableSnapshot
Test snapshotting a table that is online without flushing- Throws:
Exception
-
testFlushTableSnapshotWithProcedure
Test simple flush snapshotting a table that is online- Throws:
Exception
-
testSnapshotFailsOnNonExistantTable
- Throws:
Exception
-
waitForSnapshotToComplete
private static void waitForSnapshotToComplete(org.apache.hadoop.hbase.master.HMaster master, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot, long timeoutNanos) throws Exception Helper method for testing async snapshot operations. Just waits for the given snapshot to complete on the server by repeatedly checking the master.- Parameters:
master- the master running the snapshotsnapshot- the snapshot to checktimeoutNanos- the timeout in nano between checks to see if the snapshot is done- Throws:
Exception
-
testAsyncFlushSnapshot
- Throws:
Exception
-
testSnapshotStateAfterMerge
- Throws:
Exception
-
testTakeSnapshotAfterMerge
- Throws:
Exception
-
testFlushCreateListDestroy
Basic end-to-end test of simple-flush-based snapshots- Throws:
Exception
-
waitRegionsAfterMerge
private void waitRegionsAfterMerge(long numRegionsAfterMerge) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
verifyRowCount
protected void verifyRowCount(HBaseTestingUtil util, org.apache.hadoop.hbase.TableName tableName, long expectedRows) throws IOException - Throws:
IOException
-
countRows
protected int countRows(org.apache.hadoop.hbase.client.Table table, byte[]... families) throws IOException - Throws:
IOException
-