@InterfaceAudience.Private public abstract class SortedCompactionPolicy extends CompactionPolicy
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private static Random |
RNG |
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 void |
filterBulk(ArrayList<HStoreFile> candidates) |
protected ArrayList<HStoreFile> |
getCurrentEligibleFiles(ArrayList<HStoreFile> candidateFiles,
List<HStoreFile> filesCompacting) |
long |
getNextMajorCompactTime(Collection<HStoreFile> filesToCompact)
n * @return When to run next major compaction
|
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
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)
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 void 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–2020 The Apache Software Foundation. All rights reserved.