Class DefaultCompactionStrategy
- java.lang.Object
-
- org.apache.accumulo.tserver.compaction.CompactionStrategy
-
- org.apache.accumulo.tserver.compaction.DefaultCompactionStrategy
-
- Direct Known Subclasses:
BasicCompactionStrategy,SizeLimitCompactionStrategy,TooManyDeletesCompactionStrategy
public class DefaultCompactionStrategy extends CompactionStrategy
-
-
Constructor Summary
Constructors Constructor Description DefaultCompactionStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompactionPlangetCompactionPlan(MajorCompactionRequest request)Get the plan for compacting a tablets files.booleanshouldCompact(MajorCompactionRequest request)Determine if this tablet is eligible for a major compaction.-
Methods inherited from class org.apache.accumulo.tserver.compaction.CompactionStrategy
gatherInformation, init
-
-
-
-
Method Detail
-
shouldCompact
public boolean shouldCompact(MajorCompactionRequest request)
Description copied from class:CompactionStrategyDetermine if this tablet is eligible for a major compaction. It's ok if it later determines (throughCompactionStrategy.gatherInformation(MajorCompactionRequest)andCompactionStrategy.getCompactionPlan(MajorCompactionRequest)) that it does not need to. Any state stored during shouldCompact will no longer exist whenCompactionStrategy.gatherInformation(MajorCompactionRequest)andCompactionStrategy.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.
- Specified by:
shouldCompactin classCompactionStrategy
-
getCompactionPlan
public CompactionPlan getCompactionPlan(MajorCompactionRequest request)
Description copied from class:CompactionStrategyGet the plan for compacting a tablets files. 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.
- Specified by:
getCompactionPlanin classCompactionStrategy- Parameters:
request- basic details about the tablet- Returns:
- the plan for a major compaction, or null to cancel the compaction.
-
-