Class CompactionPolicy
java.lang.Object
org.apache.hadoop.hbase.regionserver.compactions.CompactionPolicy
- Direct Known Subclasses:
SortedCompactionPolicy,StripeCompactionPolicy
A compaction policy determines how to select files for compaction, how to compact them, and how
to generate the compacted files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CompactionConfigurationprotected StoreConfigInformation -
Constructor Summary
ConstructorsConstructorDescriptionCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo) -
Method Summary
Modifier and TypeMethodDescriptiongetConf()Returns The current compaction configuration settings.voidsetConf(org.apache.hadoop.conf.Configuration conf) Inform the policy that some configuration has been change, so cached value should be updated it any.abstract booleanshouldPerformMajorCompaction(Collection<HStoreFile> filesToCompact) abstract booleanthrottleCompaction(long compactionSize)
-
Field Details
-
comConf
-
storeConfigInfo
-
-
Constructor Details
-
CompactionPolicy
public CompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
-
-
Method Details
-
shouldPerformMajorCompaction
public abstract boolean shouldPerformMajorCompaction(Collection<HStoreFile> filesToCompact) throws IOException - Parameters:
filesToCompact- Files to compact. Can be null.- Returns:
- True if we should run a major compaction.
- Throws:
IOException
-
throttleCompaction
- Parameters:
compactionSize- Total size of some compaction- Returns:
- whether this should be a large or small compaction
-
setConf
Inform the policy that some configuration has been change, so cached value should be updated it any. -
getConf
Returns The current compaction configuration settings.
-