@InterfaceAudience.Private public class RatioBasedCompactionPolicy extends CompactionPolicy
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
private Random |
random
Used calculation jitter
|
comConf, storeConfigInfo
Constructor and Description |
---|
RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo) |
Modifier and Type | Method and Description |
---|---|
(package private) ArrayList<StoreFile> |
applyCompactionPolicy(ArrayList<StoreFile> candidates,
boolean mayUseOffPeak,
boolean mayBeStuck) |
private ArrayList<StoreFile> |
checkMinFilesCriteria(ArrayList<StoreFile> candidates) |
private ArrayList<StoreFile> |
filterBulk(ArrayList<StoreFile> candidates) |
private ArrayList<StoreFile> |
getCurrentEligibleFiles(ArrayList<StoreFile> candidateFiles,
List<StoreFile> filesCompacting) |
long |
getNextMajorCompactTime(Collection<StoreFile> filesToCompact) |
boolean |
isMajorCompaction(Collection<StoreFile> filesToCompact) |
boolean |
needsCompaction(Collection<StoreFile> storeFiles,
List<StoreFile> filesCompacting) |
List<StoreFile> |
preSelectCompactionForCoprocessor(Collection<StoreFile> candidates,
List<StoreFile> filesCompacting) |
private ArrayList<StoreFile> |
removeExcessFiles(ArrayList<StoreFile> candidates,
boolean isUserCompaction,
boolean isMajorCompaction) |
CompactionRequest |
selectCompaction(Collection<StoreFile> candidateFiles,
List<StoreFile> filesCompacting,
boolean isUserCompaction,
boolean mayUseOffPeak,
boolean forceMajor) |
private ArrayList<StoreFile> |
skipLargeFiles(ArrayList<StoreFile> candidates,
boolean mayUseOffpeak) |
boolean |
throttleCompaction(long compactionSize) |
getConf, setConf
private static final org.apache.commons.logging.Log LOG
private final Random random
public RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
private ArrayList<StoreFile> getCurrentEligibleFiles(ArrayList<StoreFile> candidateFiles, List<StoreFile> filesCompacting)
public List<StoreFile> preSelectCompactionForCoprocessor(Collection<StoreFile> candidates, List<StoreFile> filesCompacting)
public CompactionRequest selectCompaction(Collection<StoreFile> candidateFiles, List<StoreFile> filesCompacting, boolean isUserCompaction, boolean mayUseOffPeak, boolean forceMajor) throws IOException
candidateFiles
- candidate files, ordered from oldest to newest. All files in store.IOException
private ArrayList<StoreFile> skipLargeFiles(ArrayList<StoreFile> candidates, boolean mayUseOffpeak)
candidates
- pre-filtrateprivate ArrayList<StoreFile> filterBulk(ArrayList<StoreFile> candidates)
candidates
- pre-filtrateprivate ArrayList<StoreFile> removeExcessFiles(ArrayList<StoreFile> candidates, boolean isUserCompaction, boolean isMajorCompaction)
candidates
- pre-filtrateprivate ArrayList<StoreFile> checkMinFilesCriteria(ArrayList<StoreFile> candidates)
candidates
- pre-filtrateArrayList<StoreFile> applyCompactionPolicy(ArrayList<StoreFile> candidates, boolean mayUseOffPeak, boolean mayBeStuck) throws IOException
candidates
- pre-filtrateIOException
public boolean isMajorCompaction(Collection<StoreFile> filesToCompact) throws IOException
isMajorCompaction
in class CompactionPolicy
filesToCompact
- Files to compact. Can be null.IOException
public long getNextMajorCompactTime(Collection<StoreFile> filesToCompact)
filesToCompact
- public boolean throttleCompaction(long compactionSize)
throttleCompaction
in class CompactionPolicy
compactionSize
- Total size of some compactionpublic boolean needsCompaction(Collection<StoreFile> storeFiles, List<StoreFile> filesCompacting)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.