Class TestDefaultMemStore
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestDefaultMemStore
- Direct Known Subclasses:
TestCompactingMemStore
memstore test case
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate class
private static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.apache.hadoop.hbase.regionserver.ChunkCreator
static final HBaseClassTestRule
protected static final byte[]
private static final org.slf4j.Logger
protected org.apache.hadoop.hbase.regionserver.AbstractMemStore
protected org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl
org.junit.rules.TestName
protected static final int
protected static final int
protected AtomicLong
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addRegionToMETA
(org.apache.hadoop.hbase.regionserver.HRegion meta, org.apache.hadoop.hbase.regionserver.HRegion r) Inserts a new region's meta information into the passedmeta
region.private static void
addRows
(int count, org.apache.hadoop.hbase.regionserver.MemStore mem) protected int
addRows
(org.apache.hadoop.hbase.regionserver.AbstractMemStore hmc) AddsROW_COUNT
rows andQUALIFIER_COUNT
protected int
addRows
(org.apache.hadoop.hbase.regionserver.MemStore hmc, long ts) AddsROW_COUNT
rows andQUALIFIER_COUNT
protected void
assertScannerResults
(org.apache.hadoop.hbase.regionserver.KeyValueScanner scanner, org.apache.hadoop.hbase.KeyValue[] expected) protected void
checkShouldFlush
(org.apache.hadoop.conf.Configuration conf, boolean expected) (package private) static void
doScan
(org.apache.hadoop.hbase.regionserver.MemStore ms, int iteration) private String
getName()
protected void
private void
isExpectedRowWithoutTimestamps
(int rowIndex, List<org.apache.hadoop.hbase.Cell> kvs) static void
private static byte[]
makeQualifier
(int i1, int i2) private long
runSnapshot
(org.apache.hadoop.hbase.regionserver.AbstractMemStore hmc) void
setUp()
static void
void
void
Test getNextRow from memstorevoid
void
void
void
void
void
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.void
Regression test for HBASE-2616, HBASE-2670.void
void
void
void
void
void
void
void
Test memstore snapshot happening while scanning.void
A simple test which verifies the 3 possible states when scanning across snapshot.void
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.void
void
Test memstore snapshotsvoid
Tests that the timeOfOldestEdit is updated correctly for the various edit operations in memstore.void
Add keyvalues with a fixed memstoreTs, and checks that memstore size is decreased as older keyvalues are deleted from the memstore.protected void
verifyOneScanAcrossSnapshot2
(org.apache.hadoop.hbase.KeyValue kv1, org.apache.hadoop.hbase.KeyValue kv2) protected void
verifyScanAcrossSnapshot2
(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
-
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 passedmeta
region.- Parameters:
meta
- hbase:meta HRegion to be updatedr
- HRegion to add tometa
- Throws:
IOException
-
addRows
AddsROW_COUNT
rows andQUALIFIER_COUNT
- Parameters:
hmc
- Instance to add rows to.- Returns:
- How many rows we added.
-
addRows
AddsROW_COUNT
rows 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
-