Class AdaptiveMemStoreCompactionStrategy
java.lang.Object
org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy
org.apache.hadoop.hbase.regionserver.AdaptiveMemStoreCompactionStrategy
Adaptive is a heuristic that chooses whether to apply data compaction or not based on the level
of redundancy in the data. Adaptive triggers redundancy elimination only for those stores where
positive impact is expected. Adaptive uses two parameters to determine whether to perform
redundancy elimination. The first parameter, u, estimates the ratio of unique keys in the memory
store based on the fraction of unique keys encountered during the previous merge of segment
indices. The second is the perceived probability (compactionProbability) that the store can
benefit from redundancy elimination. Initially, compactionProbability=0.5; it then grows
exponentially by 2% whenever a compaction is successful and decreased by 2% whenever a compaction
did not meet the expectation. It is reset back to the default value (namely 0.5) upon disk flush.
Adaptive triggers redundancy elimination with probability compactionProbability if the fraction
of redundant keys 1-u exceeds a parameter threshold compactionThreshold.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy
MemStoreCompactionStrategy.Action -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doublestatic final Stringprivate static final doublestatic final Stringprivate static final doubleprivate booleanprivate doubleprivate doubleprivate doubleprivate static final Stringprivate doubleFields inherited from class org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy
cfName, COMPACTING_MEMSTORE_THRESHOLD_DEFAULT, COMPACTING_MEMSTORE_THRESHOLD_KEY, LOG, pipelineThreshold -
Constructor Summary
ConstructorsConstructorDescriptionAdaptiveMemStoreCompactionStrategy(org.apache.hadoop.conf.Configuration conf, String cfName) -
Method Summary
Modifier and TypeMethodDescriptiongetAction(VersionedSegmentsList versionedList) protected MemStoreCompactionStrategy.Actionprotected MemStoreCompactionStrategy.Actionprotected StringgetName()voidvoidupdateStats(Segment replacement) Methods inherited from class org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy
compact, simpleMergeOrFlatten, toString
-
Field Details
-
NAME
- See Also:
-
ADAPTIVE_COMPACTION_THRESHOLD_KEY
- See Also:
-
ADAPTIVE_COMPACTION_THRESHOLD_DEFAULT
- See Also:
-
ADAPTIVE_INITIAL_COMPACTION_PROBABILITY_KEY
- See Also:
-
ADAPTIVE_INITIAL_COMPACTION_PROBABILITY_DEFAULT
- See Also:
-
ADAPTIVE_PROBABILITY_FACTOR
- See Also:
-
compactionThreshold
-
initialCompactionProbability
-
compactionProbability
-
numCellsInVersionedList
-
compacted
-
-
Constructor Details
-
AdaptiveMemStoreCompactionStrategy
-
-
Method Details
-
getAction
- Specified by:
getActionin classMemStoreCompactionStrategy
-
updateStats
- Overrides:
updateStatsin classMemStoreCompactionStrategy
-
resetStats
- Overrides:
resetStatsin classMemStoreCompactionStrategy
-
getMergingAction
- Overrides:
getMergingActionin classMemStoreCompactionStrategy
-
getFlattenAction
- Overrides:
getFlattenActionin classMemStoreCompactionStrategy
-
getName
- Specified by:
getNamein classMemStoreCompactionStrategy
-