@InterfaceAudience.Private public abstract class AbstractMemStore extends Object implements MemStore
| Modifier and Type | Field and Description |
|---|---|
static long |
DEEP_OVERHEAD |
static long |
FIXED_OVERHEAD |
protected RegionServicesForStores |
regionServices |
protected ImmutableSegment |
snapshot |
protected long |
snapshotId |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractMemStore(org.apache.hadoop.conf.Configuration conf,
CellComparator c,
RegionServicesForStores regionServices) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Cell cell,
MemStoreSizing memstoreSizing)
Write an update
|
void |
add(Iterable<Cell> cells,
MemStoreSizing memstoreSizing)
Write the updates
|
static void |
addToScanners(List<? extends Segment> segments,
long readPt,
List<KeyValueScanner> scanners) |
protected static void |
addToScanners(Segment segment,
long readPt,
List<KeyValueScanner> scanners) |
void |
clearSnapshot(long id)
This method is protected under HStore write lock.
The passed snapshot was successfully persisted; it can be let go. |
protected void |
doAdd(MutableSegment currentActive,
Cell cell,
MemStoreSizing memstoreSizing) |
protected void |
doClearSnapShot() |
protected void |
dump(org.slf4j.Logger log) |
protected CellComparator |
getComparator() |
protected org.apache.hadoop.conf.Configuration |
getConfiguration() |
protected Cell |
getLowest(Cell a,
Cell b) |
protected Cell |
getNextRow(Cell key,
NavigableSet<Cell> set) |
protected abstract List<Segment> |
getSegments()
Returns an ordered list of segments from most recent to oldest in memstore
|
MemStoreSize |
getSnapshotSize()
Return the size of the snapshot(s) if any
|
protected abstract long |
heapSize() |
protected abstract long |
keySize()
Returns The total size of cells in this memstore.
|
protected abstract void |
postUpdate(MutableSegment currentActive)
Issue any post update synchronization and tests
|
protected abstract boolean |
preUpdate(MutableSegment currentActive,
Cell cell,
MemStoreSizing memstoreSizing)
Issue any synchronization and test needed before applying the update
|
protected void |
resetActive() |
protected void |
resetTimeOfOldestEdit() |
protected abstract boolean |
sizeAddedPreOperation() |
long |
timeOfOldestEdit()
Returns Oldest timestamp of all the Cells in the MemStore
|
String |
toString() |
abstract void |
updateLowestUnflushedSequenceIdInWAL(boolean onlyIfMoreRecent)
Updates the wal with the lowest sequence id (oldest entry) that is still in memory
|
void |
upsert(Iterable<Cell> cells,
long readpoint,
MemStoreSizing memstoreSizing)
Update or insert the specified cells.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFlushableSize, getScanners, isSloppy, preFlushSeqIDEstimation, size, snapshot, startReplayingFromWAL, stopReplayingFromWALprotected volatile ImmutableSegment snapshot
protected volatile long snapshotId
protected RegionServicesForStores regionServices
public static final long FIXED_OVERHEAD
public static final long DEEP_OVERHEAD
protected AbstractMemStore(org.apache.hadoop.conf.Configuration conf,
CellComparator c,
RegionServicesForStores regionServices)
public static void addToScanners(List<? extends Segment> segments, long readPt, List<KeyValueScanner> scanners)
protected static void addToScanners(Segment segment, long readPt, List<KeyValueScanner> scanners)
protected void resetActive()
protected void resetTimeOfOldestEdit()
public abstract void updateLowestUnflushedSequenceIdInWAL(boolean onlyIfMoreRecent)
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 void add(Iterable<Cell> cells, MemStoreSizing memstoreSizing)
MemStorepublic void add(Cell cell, MemStoreSizing memstoreSizing)
MemStoreprotected void doAdd(MutableSegment currentActive, Cell cell, MemStoreSizing memstoreSizing)
protected abstract boolean preUpdate(MutableSegment currentActive, Cell cell, MemStoreSizing memstoreSizing)
currentActive - the segment to be updatedcell - the cell to be addedmemstoreSizing - object to accumulate region size changesprotected abstract void postUpdate(MutableSegment currentActive)
currentActive - updated segmentpublic void upsert(Iterable<Cell> cells, long readpoint, MemStoreSizing memstoreSizing)
MemStoreFor each Cell, insert into MemStore. This will atomically upsert the value for that row/family/qualifier. If a Cell did already exist, it will then be removed.
Currently the memstoreTS is kept at 0 so as each insert happens, it will be immediately visible. May want to change this so it is atomic across all KeyValues.
This is called under row lock, so Get operations will still see updates atomically. Scans will only see each KeyValue update as atomic.
public long timeOfOldestEdit()
timeOfOldestEdit in interface MemStorepublic void clearSnapshot(long id)
throws UnexpectedStateException
clearSnapshot in interface MemStoreid - Id of the snapshot to clean out.UnexpectedStateExceptionMemStore.snapshot()protected void doClearSnapShot()
public MemStoreSize getSnapshotSize()
MemStoregetSnapshotSize in interface MemStoreprotected org.apache.hadoop.conf.Configuration getConfiguration()
protected void dump(org.slf4j.Logger log)
protected Cell getNextRow(Cell key, NavigableSet<Cell> set)
protected abstract boolean sizeAddedPreOperation()
protected abstract long keySize()
protected abstract long heapSize()
protected CellComparator getComparator()
protected abstract List<Segment> getSegments() throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.