Class TestDefaultMemStore
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestDefaultMemStore
- Direct Known Subclasses:
TestCompactingMemStore
memstore test case
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.hadoop.hbase.regionserver.ChunkCreatorstatic final HBaseClassTestRuleprotected static final byte[]private static final org.slf4j.Loggerprotected org.apache.hadoop.hbase.regionserver.AbstractMemStoreprotected org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControlorg.junit.rules.TestNameprotected static final intprotected static final intprotected AtomicLong -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddRegionToMETA(org.apache.hadoop.hbase.regionserver.HRegion meta, org.apache.hadoop.hbase.regionserver.HRegion r) Inserts a new region's meta information into the passedmetaregion.private static voidaddRows(int count, org.apache.hadoop.hbase.regionserver.MemStore mem) protected intaddRows(org.apache.hadoop.hbase.regionserver.AbstractMemStore hmc) AddsROW_COUNTrows andQUALIFIER_COUNTprotected intaddRows(org.apache.hadoop.hbase.regionserver.MemStore hmc, long ts) AddsROW_COUNTrows andQUALIFIER_COUNTprotected voidassertScannerResults(org.apache.hadoop.hbase.regionserver.KeyValueScanner scanner, org.apache.hadoop.hbase.KeyValue[] expected) protected voidcheckShouldFlush(org.apache.hadoop.conf.Configuration conf, boolean expected) (package private) static voiddoScan(org.apache.hadoop.hbase.regionserver.MemStore ms, int iteration) private longprivate StringgetName()protected voidprivate voidisExpectedRowWithoutTimestamps(int rowIndex, List<org.apache.hadoop.hbase.Cell> kvs) static voidprivate static byte[]makeQualifier(int i1, int i2) private longrunSnapshot(org.apache.hadoop.hbase.regionserver.AbstractMemStore hmc) voidsetUp()static voidvoidvoidvoidvoidTest getNextRow from memstorevoidvoidvoidvoidvoidvoidWhen we insert a higher-memstoreTS deletion of a cell but with the same timestamp, we still need to provide consistent reads for the same scanner.voidRegression test for HBASE-2616, HBASE-2670.voidvoidvoidvoidvoidvoidvoidvoidTest memstore snapshot happening while scanning.voidA simple test which verifies the 3 possible states when scanning across snapshot.voidTests the HRegion.shouldFlush method - adds an edit in the memstore and checks that shouldFlush returns true, and another where it disables the periodic flush functionality and tests whether shouldFlush returns false.voidvoidTest memstore snapshotsvoidTests that the timeOfOldestEdit is updated correctly for the various edit operations in memstore.voidAdd keyvalues with a fixed memstoreTs, and checks that memstore size is decreased as older keyvalues are deleted from the memstore.protected voidverifyOneScanAcrossSnapshot2(org.apache.hadoop.hbase.KeyValue kv1, org.apache.hadoop.hbase.KeyValue kv2) protected voidverifyScanAcrossSnapshot2(org.apache.hadoop.hbase.KeyValue kv1, org.apache.hadoop.hbase.KeyValue kv2)
-
Field Details
-
CLASS_RULE
-
LOG
-
name
-
memstore
-
ROW_COUNT
- See Also:
-
QUALIFIER_COUNT
- See Also:
-
FAMILY
-
mvcc
-
startSeqNum
-
chunkCreator
-
-
Constructor Details
-
TestDefaultMemStore
public TestDefaultMemStore()
-
-
Method Details
-
getName
-
setUp
- Throws:
Exception
-
tearDownClass
- Throws:
Exception
-
internalSetUp
- Throws:
Exception
-
testPutSameKey
-
testPutSameCell
-
testScanAcrossSnapshot
Test memstore snapshot happening while scanning.- Throws:
IOException
-
testScanAcrossSnapshot2
A simple test which verifies the 3 possible states when scanning across snapshot. -
verifyScanAcrossSnapshot2
protected void verifyScanAcrossSnapshot2(org.apache.hadoop.hbase.KeyValue kv1, org.apache.hadoop.hbase.KeyValue kv2) throws IOException - Throws:
IOException
-
verifyOneScanAcrossSnapshot2
protected void verifyOneScanAcrossSnapshot2(org.apache.hadoop.hbase.KeyValue kv1, org.apache.hadoop.hbase.KeyValue kv2) throws IOException - Throws:
IOException
-
assertScannerResults
protected void assertScannerResults(org.apache.hadoop.hbase.regionserver.KeyValueScanner scanner, org.apache.hadoop.hbase.KeyValue[] expected) throws IOException - Throws:
IOException
-
testMemstoreConcurrentControl
- Throws:
IOException
-
getBytesReadFromMemstore
- Throws:
IOException
-
testBytesReadFromMemstore
- Throws:
IOException
-
testBytesReadFromMemstoreWithScanMetricsDisabled
- Throws:
IOException
-
testMemstoreEditsVisibilityWithSameKey
Regression test for HBASE-2616, HBASE-2670. When we insert a higher-memstoreTS version of a cell but with the same timestamp, we still need to provide consistent reads for the same scanner.- Throws:
IOException
-
testMemstoreDeletesVisibilityWithSameKey
When we insert a higher-memstoreTS deletion of a cell but with the same timestamp, we still need to provide consistent reads for the same scanner.- Throws:
IOException
-
testReadOwnWritesUnderConcurrency
- Throws:
Throwable
-
testSnapshotting
Test memstore snapshots- Throws:
IOException
-
testMultipleVersionsSimple
- Throws:
Exception
-
testGetNextRow
Test getNextRow from memstore- Throws:
Exception
-
testGet_memstoreAndSnapShot
- Throws:
IOException
-
testGetWithDelete
- Throws:
IOException
-
testGetWithDeleteColumn
- Throws:
IOException
-
testGetWithDeleteFamily
- Throws:
IOException
-
testKeepDeleteInmemstore
-
testRetainsDeleteVersion
- Throws:
IOException
-
testRetainsDeleteColumn
- Throws:
IOException
-
testRetainsDeleteFamily
- Throws:
IOException
-
makeQualifier
-
testUpsertMemstoreSize
Add keyvalues with a fixed memstoreTs, and checks that memstore size is decreased as older keyvalues are deleted from the memstore.- Throws:
Exception
-
testUpdateToTimeOfOldestEdit
Tests that the timeOfOldestEdit is updated correctly for the various edit operations in memstore.- Throws:
Exception
-
testShouldFlush
Tests the HRegion.shouldFlush method - adds an edit in the memstore and checks that shouldFlush returns true, and another where it disables the periodic flush functionality and tests whether shouldFlush returns false.- Throws:
Exception
-
checkShouldFlush
protected void checkShouldFlush(org.apache.hadoop.conf.Configuration conf, boolean expected) throws Exception - Throws:
Exception
-
testShouldFlushMeta
- Throws:
Exception
-
addRegionToMETA
private static void addRegionToMETA(org.apache.hadoop.hbase.regionserver.HRegion meta, org.apache.hadoop.hbase.regionserver.HRegion r) throws IOException Inserts a new region's meta information into the passedmetaregion.- Parameters:
meta- hbase:meta HRegion to be updatedr- HRegion to add tometa- Throws:
IOException
-
addRows
AddsROW_COUNTrows andQUALIFIER_COUNT- Parameters:
hmc- Instance to add rows to.- Returns:
- How many rows we added.
-
addRows
AddsROW_COUNTrows andQUALIFIER_COUNT- Parameters:
hmc- Instance to add rows to.- Returns:
- How many rows we added.
-
runSnapshot
private long runSnapshot(org.apache.hadoop.hbase.regionserver.AbstractMemStore hmc) throws org.apache.hadoop.hbase.exceptions.UnexpectedStateException - Throws:
org.apache.hadoop.hbase.exceptions.UnexpectedStateException
-
isExpectedRowWithoutTimestamps
-
addRows
-
doScan
static void doScan(org.apache.hadoop.hbase.regionserver.MemStore ms, int iteration) throws IOException - Throws:
IOException
-
main
- Throws:
IOException
-