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
Modifier and TypeFieldDescriptionprivate static final double
static final String
private static final double
static final String
private static final double
private boolean
private double
private double
private double
private static final String
private double
Fields inherited from class org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy
cfName, COMPACTING_MEMSTORE_THRESHOLD_DEFAULT, COMPACTING_MEMSTORE_THRESHOLD_KEY, LOG, pipelineThreshold
-
Constructor Summary
ConstructorDescriptionAdaptiveMemStoreCompactionStrategy
(org.apache.hadoop.conf.Configuration conf, String cfName) -
Method Summary
Modifier and TypeMethodDescriptiongetAction
(VersionedSegmentsList versionedList) protected MemStoreCompactionStrategy.Action
protected MemStoreCompactionStrategy.Action
protected String
getName()
void
void
updateStats
(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:
getAction
in classMemStoreCompactionStrategy
-
updateStats
- Overrides:
updateStats
in classMemStoreCompactionStrategy
-
resetStats
- Overrides:
resetStats
in classMemStoreCompactionStrategy
-
getMergingAction
- Overrides:
getMergingAction
in classMemStoreCompactionStrategy
-
getFlattenAction
- Overrides:
getFlattenAction
in classMemStoreCompactionStrategy
-
getName
- Specified by:
getName
in classMemStoreCompactionStrategy
-