@InterfaceAudience.Private public class DefaultMemStore extends AbstractMemStore
Cells. When
asked to flush, current memstore is moved to snapshot and is cleared. We continue to serve edits
out of new memstore and backing snapshot until flusher reports in that the flush succeeded. At
this point we let the snapshot go.
The MemStore functions should not be called in parallel. Callers should hold write and read
locks. This is done in HStore.
| Modifier and Type | Field and Description |
|---|---|
static long |
DEEP_OVERHEAD |
static long |
FIXED_OVERHEAD |
private static org.slf4j.Logger |
LOG |
regionServices, snapshot, snapshotId| Constructor and Description |
|---|
DefaultMemStore()
Default constructor.
|
DefaultMemStore(org.apache.hadoop.conf.Configuration conf,
CellComparator c)
Constructor.
|
DefaultMemStore(org.apache.hadoop.conf.Configuration conf,
CellComparator c,
RegionServicesForStores regionServices)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
MemStoreSize |
getFlushableSize()
Flush will first clear out the data in snapshot if any (It will take a second flush invocation
to clear the current Cell set).
|
(package private) Cell |
getNextRow(Cell cell) |
List<KeyValueScanner> |
getScanners(long readPt) |
protected List<Segment> |
getSegments()
Returns an ordered list of segments from most recent to oldest in memstore
|
protected List<Segment> |
getSnapshotSegments() |
protected long |
heapSize() |
boolean |
isSloppy() |
protected long |
keySize()
Returns The total size of cells in this memstore.
|
static void |
main(String[] args)
Code to help figure if our approximation of object heap sizes is close enough.
|
protected void |
postUpdate(MutableSegment currentActive)
Issue any post update synchronization and tests
|
long |
preFlushSeqIDEstimation()
This method is called before the flush is executed.
|
protected boolean |
preUpdate(MutableSegment currentActive,
Cell cell,
MemStoreSizing memstoreSizing)
Issue any synchronization and test needed before applying the update
|
MemStoreSize |
size() |
protected boolean |
sizeAddedPreOperation() |
MemStoreSnapshot |
snapshot()
Creates a snapshot of the current memstore.
|
void |
updateLowestUnflushedSequenceIdInWAL(boolean onlyIfMoreRecent)
Updates the wal with the lowest sequence id (oldest entry) that is still in memory
|
add, add, addToScanners, addToScanners, clearSnapshot, doAdd, doClearSnapShot, dump, getActive, getComparator, getConfiguration, getLowest, getNextRow, getSnapshot, getSnapshotSize, resetActive, resetTimeOfOldestEdit, timeOfOldestEdit, toString, upsertclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitstartReplayingFromWAL, stopReplayingFromWALprivate static final org.slf4j.Logger LOG
public static final long DEEP_OVERHEAD
public static final long FIXED_OVERHEAD
public DefaultMemStore()
public DefaultMemStore(org.apache.hadoop.conf.Configuration conf, CellComparator c)
c - Comparatorpublic DefaultMemStore(org.apache.hadoop.conf.Configuration conf, CellComparator c, RegionServicesForStores regionServices)
c - Comparatorpublic MemStoreSnapshot snapshot()
AbstractMemStore.clearSnapshot(long)MemStoreSnapshotpublic MemStoreSize getFlushableSize()
MemStoreprotected long keySize()
AbstractMemStorekeySize in class AbstractMemStoreprotected long heapSize()
heapSize in class AbstractMemStorepublic List<KeyValueScanner> getScanners(long readPt) throws IOException
IOExceptionprotected List<Segment> getSnapshotSegments()
protected List<Segment> getSegments() throws IOException
AbstractMemStoregetSegments in class AbstractMemStoreIOExceptionCell getNextRow(Cell cell)
cell - Find the row that comes after this one. If null, we return the first.public void updateLowestUnflushedSequenceIdInWAL(boolean onlyIfMoreRecent)
AbstractMemStoreupdateLowestUnflushedSequenceIdInWAL in class AbstractMemStoreonlyIfMoreRecent - a flag that marks whether to update the sequence id no matter what or
only if it is greater than the previous sequence idprotected boolean preUpdate(MutableSegment currentActive, Cell cell, MemStoreSizing memstoreSizing)
AbstractMemStorepreUpdate in class AbstractMemStorecurrentActive - the segment to be updatedcell - the cell to be addedmemstoreSizing - object to accumulate region size changesprotected void postUpdate(MutableSegment currentActive)
AbstractMemStorepostUpdate in class AbstractMemStorecurrentActive - updated segmentprotected boolean sizeAddedPreOperation()
sizeAddedPreOperation in class AbstractMemStorepublic MemStoreSize size()
public long preFlushSeqIDEstimation()
MemStoreHConstants.NO_SEQNUM.public boolean isSloppy()
public static void main(String[] args)
args - main argsCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.