public class CompactingMemStore extends AbstractMemStore
| Modifier and Type | Class and Description |
|---|---|
static class |
CompactingMemStore.IndexType
Types of indexes (part of immutable segments) to be used after flattening,
compaction, or merge are applied.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicBoolean |
allowCompaction |
static java.lang.String |
COMPACTING_MEMSTORE_TYPE_DEFAULT |
static java.lang.String |
COMPACTING_MEMSTORE_TYPE_KEY |
protected MemStoreCompactor |
compactor |
static long |
DEEP_OVERHEAD |
static java.lang.String |
IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY |
active, FIXED_OVERHEAD, snapshot, snapshotId| Constructor and Description |
|---|
CompactingMemStore(Configuration conf,
CellComparator c,
HStore store,
RegionServicesForStores regionServices,
MemoryCompactionPolicy compactionPolicy) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkActiveSize()
Check whether anything need to be done based on the current active set size.
|
protected java.util.List<KeyValueScanner> |
createList(int capacity) |
protected MemStoreCompactor |
createMemStoreCompactor(MemoryCompactionPolicy compactionPolicy) |
void |
debug() |
void |
flattenOneSegment(long requesterVersion,
MemStoreCompactionStrategy.Action action) |
java.lang.String |
getFamilyName() |
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).
|
VersionedSegmentsList |
getImmutableSegments() |
CompactingMemStore.IndexType |
getIndexType() |
java.util.List<KeyValueScanner> |
getScanners(long readPt) |
protected java.util.List<Segment> |
getSegments() |
long |
getSmallestReadPoint() |
HStore |
getStore() |
boolean |
hasImmutableSegments() |
protected long |
heapSize() |
boolean |
isSloppy() |
protected long |
keySize() |
long |
preFlushSeqIDEstimation()
This method is called before the flush is executed.
|
protected void |
pushActiveToPipeline(MutableSegment active) |
void |
setCompositeSnapshot(boolean useCompositeSnapshot) |
protected boolean |
shouldFlushInMemory() |
MemStoreSize |
size() |
MemStoreSnapshot |
snapshot()
Push the current active memstore segment into the pipeline
and create a snapshot of the tail of current compaction pipeline
Snapshot must be cleared by call to
AbstractMemStore.clearSnapshot(long). |
void |
startReplayingFromWAL()
This message intends to inform the MemStore that next coming updates
are going to be part of the replaying edits from WAL
|
void |
stopReplayingFromWAL()
This message intends to inform the MemStore that the replaying edits from WAL
are done
|
boolean |
swapCompactedSegments(VersionedSegmentsList versionedList,
ImmutableSegment result,
boolean merge) |
void |
updateLowestUnflushedSequenceIdInWAL(boolean onlyIfGreater)
Updates the wal with the lowest sequence id (oldest entry) that is still in memory
|
add, add, addToScanners, addToScanners, clearSnapshot, dump, getComparator, getConfiguration, getLowest, getNextRow, getSnapshotSize, resetActive, timeOfOldestEdit, toString, upsertpublic static final java.lang.String COMPACTING_MEMSTORE_TYPE_KEY
public static final java.lang.String COMPACTING_MEMSTORE_TYPE_DEFAULT
public static final java.lang.String IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY
protected MemStoreCompactor compactor
protected final java.util.concurrent.atomic.AtomicBoolean allowCompaction
public static final long DEEP_OVERHEAD
public CompactingMemStore(Configuration conf,
CellComparator c,
HStore store,
RegionServicesForStores regionServices,
MemoryCompactionPolicy compactionPolicy)
throws java.io.IOException
java.io.IOExceptionprotected MemStoreCompactor createMemStoreCompactor(MemoryCompactionPolicy compactionPolicy) throws IllegalArgumentIOException
IllegalArgumentIOExceptionpublic MemStoreSize size()
public long preFlushSeqIDEstimation()
HConstants.NO_SEQNUM.public boolean isSloppy()
public MemStoreSnapshot snapshot()
AbstractMemStore.clearSnapshot(long).
AbstractMemStore.clearSnapshot(long).MemStoreSnapshotpublic MemStoreSize getFlushableSize()
MemStoreprotected long keySize()
keySize in class AbstractMemStoreprotected long heapSize()
heapSize in class AbstractMemStorepublic void updateLowestUnflushedSequenceIdInWAL(boolean onlyIfGreater)
AbstractMemStoreupdateLowestUnflushedSequenceIdInWAL in class AbstractMemStoreonlyIfGreater - 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 startReplayingFromWAL()
public void stopReplayingFromWAL()
protected java.util.List<Segment> getSegments()
getSegments in class AbstractMemStorepublic void setCompositeSnapshot(boolean useCompositeSnapshot)
public boolean swapCompactedSegments(VersionedSegmentsList versionedList, ImmutableSegment result, boolean merge)
public void flattenOneSegment(long requesterVersion,
MemStoreCompactionStrategy.Action action)
requesterVersion - The caller must hold the VersionedList of the pipeline
with version taken earlier. This version must be passed as a parameter here.
The flattening happens only if versions match.public CompactingMemStore.IndexType getIndexType()
public boolean hasImmutableSegments()
public VersionedSegmentsList getImmutableSegments()
public long getSmallestReadPoint()
public HStore getStore()
public java.lang.String getFamilyName()
public java.util.List<KeyValueScanner> getScanners(long readPt) throws java.io.IOException
java.io.IOExceptionprotected java.util.List<KeyValueScanner> createList(int capacity)
protected void checkActiveSize()
checkActiveSize in class AbstractMemStoreprotected boolean shouldFlushInMemory()
protected void pushActiveToPipeline(MutableSegment active)
public void debug()