@InterfaceAudience.Private public abstract class AbstractMemStore extends Object implements MemStore
Modifier and Type | Field and Description |
---|---|
protected MutableSegment |
active |
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) |
protected abstract void |
checkActiveSize()
Check whether anything need to be done based on the current active set size
|
void |
clearSnapshot(long id)
The passed snapshot was successfully persisted; it can be let go.
|
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() |
MemStoreSize |
getSnapshotSize()
Return the size of the snapshot(s) if any
|
protected abstract long |
heapSize() |
protected abstract long |
keySize() |
protected void |
resetActive() |
long |
timeOfOldestEdit() |
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, wait
getFlushableSize, getScanners, isSloppy, preFlushSeqIDEstimation, size, snapshot, startReplayingFromWAL, stopReplayingFromWAL
protected volatile MutableSegment active
protected 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()
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)
MemStore
public void add(Cell cell, MemStoreSizing memstoreSizing)
MemStore
public void upsert(Iterable<Cell> cells, long readpoint, MemStoreSizing memstoreSizing)
MemStore
For 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 MemStore
public void clearSnapshot(long id) throws UnexpectedStateException
clearSnapshot
in interface MemStore
id
- Id of the snapshot to clean out.UnexpectedStateException
MemStore.snapshot()
public MemStoreSize getSnapshotSize()
MemStore
getSnapshotSize
in interface MemStore
protected org.apache.hadoop.conf.Configuration getConfiguration()
protected void dump(org.slf4j.Logger log)
protected Cell getNextRow(Cell key, NavigableSet<Cell> set)
protected abstract long keySize()
protected abstract long heapSize()
protected CellComparator getComparator()
protected abstract void checkActiveSize()
protected abstract List<Segment> getSegments() throws IOException
IOException
Copyright © 2007–2019 Cloudera. All rights reserved.