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
Modifier and TypeFieldDescriptionprotected CompactionConfiguration
protected StoreConfigInformation
-
Constructor Summary
ConstructorDescriptionCompactionPolicy
(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo) -
Method Summary
Modifier and TypeMethodDescriptiongetConf()
Returns The current compaction configuration settings.void
setConf
(org.apache.hadoop.conf.Configuration conf) Inform the policy that some configuration has been change, so cached value should be updated it any.abstract boolean
shouldPerformMajorCompaction
(Collection<HStoreFile> filesToCompact) abstract boolean
throttleCompaction
(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.
-