@InterfaceAudience.Private public abstract class SortedCompactionPolicy extends CompactionPolicy
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private Random |
random
Used calculation jitter
|
comConf, storeConfigInfo
Constructor and Description |
---|
SortedCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo) |
Modifier and Type | Method and Description |
---|---|
protected ArrayList<HStoreFile> |
checkMinFilesCriteria(ArrayList<HStoreFile> candidates,
int minFiles) |
protected abstract CompactionRequestImpl |
createCompactionRequest(ArrayList<HStoreFile> candidateSelection,
boolean tryingMajor,
boolean mayUseOffPeak,
boolean mayBeStuck) |
protected ArrayList<HStoreFile> |
filterBulk(ArrayList<HStoreFile> candidates) |
protected ArrayList<HStoreFile> |
getCurrentEligibleFiles(ArrayList<HStoreFile> candidateFiles,
List<HStoreFile> filesCompacting) |
long |
getNextMajorCompactTime(Collection<HStoreFile> filesToCompact) |
abstract boolean |
needsCompaction(Collection<HStoreFile> storeFiles,
List<HStoreFile> filesCompacting) |
List<HStoreFile> |
preSelectCompactionForCoprocessor(Collection<HStoreFile> candidates,
List<HStoreFile> filesCompacting) |
protected void |
removeExcessFiles(ArrayList<HStoreFile> candidates,
boolean isUserCompaction,
boolean isMajorCompaction) |
CompactionRequestImpl |
selectCompaction(Collection<HStoreFile> candidateFiles,
List<HStoreFile> filesCompacting,
boolean isUserCompaction,
boolean mayUseOffPeak,
boolean forceMajor) |
abstract boolean |
shouldPerformMajorCompaction(Collection<HStoreFile> filesToCompact) |
protected ArrayList<HStoreFile> |
skipLargeFiles(ArrayList<HStoreFile> candidates,
boolean mayUseOffpeak) |
boolean |
throttleCompaction(long compactionSize) |
getConf, setConf
private static final org.slf4j.Logger LOG
public SortedCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
public List<HStoreFile> preSelectCompactionForCoprocessor(Collection<HStoreFile> candidates, List<HStoreFile> filesCompacting)
public CompactionRequestImpl selectCompaction(Collection<HStoreFile> candidateFiles, List<HStoreFile> 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 CompactionRequestImpl createCompactionRequest(ArrayList<HStoreFile> candidateSelection, boolean tryingMajor, boolean mayUseOffPeak, boolean mayBeStuck) throws IOException
IOException
public abstract boolean shouldPerformMajorCompaction(Collection<HStoreFile> filesToCompact) throws IOException
shouldPerformMajorCompaction
in class CompactionPolicy
filesToCompact
- Files to compact. Can be null.IOException
public long getNextMajorCompactTime(Collection<HStoreFile> filesToCompact)
filesToCompact
- public boolean throttleCompaction(long compactionSize)
throttleCompaction
in class CompactionPolicy
compactionSize
- Total size of some compactionpublic abstract boolean needsCompaction(Collection<HStoreFile> storeFiles, List<HStoreFile> filesCompacting)
protected ArrayList<HStoreFile> getCurrentEligibleFiles(ArrayList<HStoreFile> candidateFiles, List<HStoreFile> filesCompacting)
protected ArrayList<HStoreFile> skipLargeFiles(ArrayList<HStoreFile> candidates, boolean mayUseOffpeak)
candidates
- pre-filtrateprotected ArrayList<HStoreFile> filterBulk(ArrayList<HStoreFile> candidates)
candidates
- pre-filtrateprotected void removeExcessFiles(ArrayList<HStoreFile> candidates, boolean isUserCompaction, boolean isMajorCompaction)
candidates
- pre-filtrateprotected ArrayList<HStoreFile> checkMinFilesCriteria(ArrayList<HStoreFile> candidates, int minFiles)
candidates
- pre-filtrateCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.