@InterfaceAudience.Private public class CompactingMemStore extends AbstractMemStore
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CompactingMemStore.IndexType
Types of indexes (part of immutable segments) to be used after flattening,
compaction, or merge are applied.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected AtomicBoolean |
allowCompaction |
static String |
COMPACTING_MEMSTORE_TYPE_DEFAULT |
static String |
COMPACTING_MEMSTORE_TYPE_KEY |
protected MemStoreCompactor |
compactor |
static long |
DEEP_OVERHEAD |
static int |
IN_MEMORY_CONPACTION_POOL_SIZE_DEFAULT |
static String |
IN_MEMORY_CONPACTION_POOL_SIZE_KEY |
static String |
IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY |
FIXED_OVERHEAD, regionServices, snapshot, snapshotId| 构造器和说明 |
|---|
CompactingMemStore(org.apache.hadoop.conf.Configuration conf,
CellComparator c,
HStore store,
RegionServicesForStores regionServices,
MemoryCompactionPolicy compactionPolicy) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected List<KeyValueScanner> |
createList(int capacity) |
protected MemStoreCompactor |
createMemStoreCompactor(MemoryCompactionPolicy compactionPolicy) |
void |
debug() |
void |
flattenOneSegment(long requesterVersion,
MemStoreCompactionStrategy.Action action) |
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() |
List<KeyValueScanner> |
getScanners(long readPt) |
protected List<Segment> |
getSegments() |
long |
getSmallestReadPoint() |
HStore |
getStore() |
boolean |
hasImmutableSegments() |
protected long |
heapSize() |
boolean |
isSloppy() |
protected long |
keySize() |
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
For compacting memstore this means checking the update can increase the size without
overflow
|
protected void |
pushActiveToPipeline(MutableSegment currActive) |
void |
setCompositeSnapshot(boolean useCompositeSnapshot) |
void |
setInMemoryCompactionCompleted() |
protected boolean |
setInMemoryCompactionFlag() |
protected boolean |
shouldFlushInMemory(MutableSegment currActive,
Cell cellToAdd,
MemStoreSizing memstoreSizing) |
MemStoreSize |
size() |
protected boolean |
sizeAddedPreOperation() |
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 String COMPACTING_MEMSTORE_TYPE_DEFAULT
public static final String IN_MEMORY_FLUSH_THRESHOLD_FACTOR_KEY
public static final String IN_MEMORY_CONPACTION_POOL_SIZE_KEY
public static final int IN_MEMORY_CONPACTION_POOL_SIZE_DEFAULT
protected MemStoreCompactor compactor
protected final AtomicBoolean allowCompaction
public static final long DEEP_OVERHEAD
public CompactingMemStore(org.apache.hadoop.conf.Configuration conf,
CellComparator c,
HStore store,
RegionServicesForStores regionServices,
MemoryCompactionPolicy compactionPolicy)
throws IOException
IOExceptionprotected MemStoreCompactor createMemStoreCompactor(MemoryCompactionPolicy compactionPolicy) throws IllegalArgumentIOException
public MemStoreSize size()
public long preFlushSeqIDEstimation()
HConstants.NO_SEQNUM.public boolean isSloppy()
public MemStoreSnapshot snapshot()
AbstractMemStore.clearSnapshot(long).
AbstractMemStore.clearSnapshot(long).MemStoreSnapshotpublic MemStoreSize getFlushableSize()
MemStorepublic void setInMemoryCompactionCompleted()
protected boolean setInMemoryCompactionFlag()
protected long keySize()
keySize 在类中 AbstractMemStoreprotected long heapSize()
heapSize 在类中 AbstractMemStorepublic void updateLowestUnflushedSequenceIdInWAL(boolean onlyIfGreater)
AbstractMemStoreupdateLowestUnflushedSequenceIdInWAL 在类中 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 boolean preUpdate(MutableSegment currentActive, Cell cell, MemStoreSizing memstoreSizing)
preUpdate 在类中 AbstractMemStorecurrentActive - the segment to be updatedcell - the cell to be addedmemstoreSizing - object to accumulate region size changesprotected void postUpdate(MutableSegment currentActive)
AbstractMemStorepostUpdate 在类中 AbstractMemStorecurrentActive - updated segmentprotected boolean sizeAddedPreOperation()
sizeAddedPreOperation 在类中 AbstractMemStoreprotected List<Segment> getSegments()
getSegments 在类中 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 String getFamilyName()
public List<KeyValueScanner> getScanners(long readPt) throws IOException
IOExceptionprotected List<KeyValueScanner> createList(int capacity)
protected boolean shouldFlushInMemory(MutableSegment currActive, Cell cellToAdd, MemStoreSizing memstoreSizing)
protected void pushActiveToPipeline(MutableSegment currActive)
public void debug()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.