@InterfaceAudience.Private public abstract class SortedCompactionPolicy extends CompactionPolicy
comConf, storeConfigInfo
Constructor and Description |
---|
SortedCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo) |
Modifier and Type | Method and Description |
---|---|
protected ArrayList<StoreFile> |
checkMinFilesCriteria(ArrayList<StoreFile> candidates,
int minFiles) |
protected abstract CompactionRequest |
createCompactionRequest(ArrayList<StoreFile> candidateSelection,
boolean tryingMajor,
boolean mayUseOffPeak,
boolean mayBeStuck) |
protected ArrayList<StoreFile> |
filterBulk(ArrayList<StoreFile> candidates) |
protected ArrayList<StoreFile> |
getCurrentEligibleFiles(ArrayList<StoreFile> candidateFiles,
List<StoreFile> filesCompacting) |
long |
getNextMajorCompactTime(Collection<StoreFile> filesToCompact) |
abstract boolean |
needsCompaction(Collection<StoreFile> storeFiles,
List<StoreFile> filesCompacting) |
List<StoreFile> |
preSelectCompactionForCoprocessor(Collection<StoreFile> candidates,
List<StoreFile> filesCompacting) |
protected void |
removeExcessFiles(ArrayList<StoreFile> candidates,
boolean isUserCompaction,
boolean isMajorCompaction) |
CompactionRequest |
selectCompaction(Collection<StoreFile> candidateFiles,
List<StoreFile> filesCompacting,
boolean isUserCompaction,
boolean mayUseOffPeak,
boolean forceMajor) |
abstract boolean |
shouldPerformMajorCompaction(Collection<StoreFile> filesToCompact) |
protected ArrayList<StoreFile> |
skipLargeFiles(ArrayList<StoreFile> candidates,
boolean mayUseOffpeak) |
boolean |
throttleCompaction(long compactionSize) |
getConf, setConf
public SortedCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
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 by seqId. We rely on
DefaultStoreFileManager to sort the files by seqId to guarantee contiguous compaction based
on seqId for data consistency.IOException
protected abstract CompactionRequest createCompactionRequest(ArrayList<StoreFile> candidateSelection, boolean tryingMajor, boolean mayUseOffPeak, boolean mayBeStuck) throws IOException
IOException
public abstract boolean shouldPerformMajorCompaction(Collection<StoreFile> filesToCompact) throws IOException
shouldPerformMajorCompaction
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 abstract boolean needsCompaction(Collection<StoreFile> storeFiles, List<StoreFile> filesCompacting)
protected ArrayList<StoreFile> getCurrentEligibleFiles(ArrayList<StoreFile> candidateFiles, List<StoreFile> filesCompacting)
protected ArrayList<StoreFile> skipLargeFiles(ArrayList<StoreFile> candidates, boolean mayUseOffpeak)
candidates
- pre-filtrateprotected ArrayList<StoreFile> filterBulk(ArrayList<StoreFile> candidates)
candidates
- pre-filtrateprotected void removeExcessFiles(ArrayList<StoreFile> candidates, boolean isUserCompaction, boolean isMajorCompaction)
candidates
- pre-filtrateCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.