Class MemStoreCompactor
java.lang.Object
org.apache.hadoop.hbase.regionserver.MemStoreCompactor
The ongoing MemStore Compaction manager, dispatches a solo running compaction and interrupts the
compaction if requested. The compaction is interrupted and stopped by CompactingMemStore, for
example when another compaction needs to be started. Prior to compaction the MemStoreCompactor
evaluates the compacting ratio and aborts the compaction if it is not worthy. The MemStoreScanner
is used to traverse the compaction pipeline. The MemStoreScanner is included in internal store
scanner, where all compaction logic is implemented. Threads safety: It is assumed that the
compaction pipeline is immutable, therefore no special synchronization is required.
-
Field Summary
Modifier and TypeFieldDescriptionprivate CompactingMemStore
private final int
static final long
private final AtomicBoolean
private static final org.slf4j.Logger
private MemStoreCompactionStrategy
private VersionedSegmentsList
-
Constructor Summary
ConstructorDescriptionMemStoreCompactor
(CompactingMemStore compactingMemStore, MemoryCompactionPolicy compactionPolicy) -
Method Summary
Modifier and TypeMethodDescriptionprivate ImmutableSegment
---------------------------------------------------------------------- Creation of the ImmutableSegment either by merge or copy-compact of the segments of the pipeline, based on the Compactor Iterator.private void
---------------------------------------------------------------------- The worker thread performs the compaction asynchronously.(package private) void
initiateCompactionStrategy
(MemoryCompactionPolicy compType, org.apache.hadoop.conf.Configuration configuration, String cfName) private void
---------------------------------------------------------------------- Reset the interruption indicator and clear the pointers in order to allow good garbage collectionvoid
boolean
start()
---------------------------------------------------------------------- The request to dispatch the compaction asynchronous task.void
stop()
---------------------------------------------------------------------- The request to cancel the compaction asynchronous task The compaction may still happen if the request was sent too late Non-blocking requesttoString()
-
Field Details
-
DEEP_OVERHEAD
-
LOG
-
compactingMemStore
-
versionedList
-
isInterrupted
-
compactionKVMax
-
strategy
-
-
Constructor Details
-
MemStoreCompactor
public MemStoreCompactor(CompactingMemStore compactingMemStore, MemoryCompactionPolicy compactionPolicy) throws IllegalArgumentIOException - Throws:
IllegalArgumentIOException
-
-
Method Details
-
toString
-
start
---------------------------------------------------------------------- The request to dispatch the compaction asynchronous task. The method returns true if compaction was successfully dispatched, or false if there is already an ongoing compaction or no segments to compact.- Throws:
IOException
-
stop
---------------------------------------------------------------------- The request to cancel the compaction asynchronous task The compaction may still happen if the request was sent too late Non-blocking request -
resetStats
-
releaseResources
---------------------------------------------------------------------- Reset the interruption indicator and clear the pointers in order to allow good garbage collection -
doCompaction
---------------------------------------------------------------------- The worker thread performs the compaction asynchronously. The solo (per compactor) thread only reads the compaction pipeline. There is at most one thread per memstore instance. -
createSubstitution
private ImmutableSegment createSubstitution(MemStoreCompactionStrategy.Action action) throws IOException ---------------------------------------------------------------------- Creation of the ImmutableSegment either by merge or copy-compact of the segments of the pipeline, based on the Compactor Iterator. The new ImmutableSegment is returned.- Throws:
IOException
-
initiateCompactionStrategy
void initiateCompactionStrategy(MemoryCompactionPolicy compType, org.apache.hadoop.conf.Configuration configuration, String cfName) throws IllegalArgumentIOException - Throws:
IllegalArgumentIOException
-