public class SizeLimitCompactionStrategy extends DefaultCompactionStrategy
| Modifier and Type | Field and Description |
|---|---|
static String |
SIZE_LIMIT_OPT |
| Constructor and Description |
|---|
SizeLimitCompactionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
gatherInformation(MajorCompactionRequest request)
Called prior to obtaining the tablet lock, useful for examining metadata or indexes.
|
CompactionPlan |
getCompactionPlan(MajorCompactionRequest request)
Get the plan for compacting a tablets files.
|
void |
init(Map<String,String> options)
The settings for the compaction strategy pulled from zookeeper.
|
boolean |
shouldCompact(MajorCompactionRequest request)
Determine if this tablet is eligible for a major compaction.
|
public static final String SIZE_LIMIT_OPT
public void init(Map<String,String> options)
CompactionStrategyinit in class CompactionStrategypublic boolean shouldCompact(MajorCompactionRequest request)
CompactionStrategyCompactionStrategy.gatherInformation(MajorCompactionRequest) and
CompactionStrategy.getCompactionPlan(MajorCompactionRequest)) that it does not need to. Any state stored during shouldCompact will no longer exist when
CompactionStrategy.gatherInformation(MajorCompactionRequest) and CompactionStrategy.getCompactionPlan(MajorCompactionRequest) are called.
Called while holding the tablet lock, so it should not be doing any blocking.
Since no blocking should be done in this method, then its unexpected that this method will throw IOException. However since its in the API, it can not be easily removed.
shouldCompact in class DefaultCompactionStrategypublic void gatherInformation(MajorCompactionRequest request) throws IOException
CompactionStrategyCompactionStrategy.getCompactionPlan(MajorCompactionRequest).gatherInformation in class CompactionStrategyrequest - basic details about the tabletIOExceptionpublic CompactionPlan getCompactionPlan(MajorCompactionRequest request)
CompactionStrategySince no blocking should be done in this method, then its unexpected that this method will throw IOException. However since its in the API, it can not be easily removed.
getCompactionPlan in class DefaultCompactionStrategyrequest - basic details about the tabletCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.