org.apache.hadoop.hbase.regionserver.compactions
Class RatioBasedCompactionPolicy
java.lang.Object
org.apache.hadoop.hbase.regionserver.compactions.CompactionPolicy
org.apache.hadoop.hbase.regionserver.compactions.RatioBasedCompactionPolicy
- Direct Known Subclasses:
- ExploringCompactionPolicy
@InterfaceAudience.Private
public class RatioBasedCompactionPolicy
- extends CompactionPolicy
The default algorithm for selecting files for compaction.
Combines the compaction configuration and the provisional file selection that
it's given to produce the list of suitable candidates for compaction.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RatioBasedCompactionPolicy
public RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo)
preSelectCompactionForCoprocessor
public List<StoreFile> preSelectCompactionForCoprocessor(Collection<StoreFile> candidates,
List<StoreFile> filesCompacting)
selectCompaction
public CompactionRequest selectCompaction(Collection<StoreFile> candidateFiles,
List<StoreFile> filesCompacting,
boolean isUserCompaction,
boolean mayUseOffPeak,
boolean forceMajor)
throws IOException
- Parameters:
candidateFiles
- candidate files, ordered from oldest to newest
- Returns:
- subset copy of candidate list that meets compaction criteria
- Throws:
IOException
isMajorCompaction
public boolean isMajorCompaction(Collection<StoreFile> filesToCompact)
throws IOException
- Specified by:
isMajorCompaction
in class CompactionPolicy
- Parameters:
filesToCompact
- Files to compact. Can be null.
- Returns:
- True if we should run a major compaction.
- Throws:
IOException
getNextMajorCompactTime
public long getNextMajorCompactTime(Collection<StoreFile> filesToCompact)
throttleCompaction
public boolean throttleCompaction(long compactionSize)
- Specified by:
throttleCompaction
in class CompactionPolicy
- Parameters:
compactionSize
- Total size of some compaction
- Returns:
- whether this should be a large or small compaction
needsCompaction
public boolean needsCompaction(Collection<StoreFile> storeFiles,
List<StoreFile> filesCompacting)
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.