@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 |
active, 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 |
---|---|
protected void |
checkActiveSize()
Check whether anything need to be done based on the current active set size
Nothing need to be done for the DefaultMemStore
|
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() |
protected long |
heapSize() |
boolean |
isSloppy() |
protected long |
keySize() |
static void |
main(String[] args)
Code to help figure if our approximation of object heap sizes is close
enough.
|
long |
preFlushSeqIDEstimation()
This method is called before the flush is executed.
|
MemStoreSize |
size() |
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, dump, getActive, getComparator, getConfiguration, getLowest, getNextRow, getSnapshot, getSnapshotSize, resetActive, 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()
keySize
in class AbstractMemStore
protected long heapSize()
heapSize
in class AbstractMemStore
public List<KeyValueScanner> getScanners(long readPt) throws IOException
IOException
protected List<Segment> getSegments() throws IOException
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 idpublic MemStoreSize size()
protected void checkActiveSize()
checkActiveSize
in class AbstractMemStore
public long preFlushSeqIDEstimation()
MemStore
HConstants.NO_SEQNUM
.public boolean isSloppy()
public static void main(String[] args)
args
- main argsCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.