@InterfaceAudience.Private public class DefaultMemStore extends AbstractMemStore
Cell
s. 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, upsert
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
startReplayingFromWAL, stopReplayingFromWAL
private 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)
MemStoreSnapshot
public MemStoreSize getFlushableSize()
MemStore
protected long keySize()
AbstractMemStore
keySize
in class AbstractMemStore
protected long heapSize()
heapSize
in class AbstractMemStore
public List<KeyValueScanner> getScanners(long readPt) throws IOException
IOException
protected List<Segment> getSnapshotSegments()
protected List<Segment> getSegments() throws IOException
AbstractMemStore
getSegments
in class AbstractMemStore
IOException
Cell getNextRow(Cell cell)
cell
- Find the row that comes after this one. If null, we return the first.public void updateLowestUnflushedSequenceIdInWAL(boolean onlyIfMoreRecent)
AbstractMemStore
updateLowestUnflushedSequenceIdInWAL
in class AbstractMemStore
onlyIfMoreRecent
- 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)
AbstractMemStore
preUpdate
in class AbstractMemStore
currentActive
- the segment to be updatedcell
- the cell to be addedmemstoreSizing
- object to accumulate region size changesprotected void postUpdate(MutableSegment currentActive)
AbstractMemStore
postUpdate
in class AbstractMemStore
currentActive
- updated segmentprotected boolean sizeAddedPreOperation()
sizeAddedPreOperation
in class AbstractMemStore
public MemStoreSize size()
public long preFlushSeqIDEstimation()
MemStore
HConstants.NO_SEQNUM
.public boolean isSloppy()
public static void main(String[] args)
args
- main argsCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.