@InterfaceAudience.Private public class RatioBasedCompactionPolicy extends SortedCompactionPolicy
comConf, storeConfigInfo
Constructor and Description |
---|
RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo) |
Modifier and Type | Method and Description |
---|---|
protected ArrayList<StoreFile> |
applyCompactionPolicy(ArrayList<StoreFile> candidates,
boolean mayUseOffPeak,
boolean mayBeStuck)
-- Default minor compaction selection algorithm:
choose CompactSelection from candidates --
First exclude bulk-load files if indicated in configuration.
|
protected CompactionRequest |
createCompactionRequest(ArrayList<StoreFile> candidateSelection,
boolean tryingMajor,
boolean mayUseOffPeak,
boolean mayBeStuck) |
boolean |
needsCompaction(Collection<StoreFile> storeFiles,
List<StoreFile> filesCompacting)
A heuristic method to decide whether to schedule a compaction request
|
void |
setMinThreshold(int minThreshold)
Overwrite min threshold for compaction
|
boolean |
shouldPerformMajorCompaction(Collection<StoreFile> filesToCompact) |
checkMinFilesCriteria, filterBulk, getCurrentEligibleFiles, getNextMajorCompactTime, preSelectCompactionForCoprocessor, removeExcessFiles, selectCompaction, skipLargeFiles, throttleCompaction
getConf, setConf
public RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
public boolean shouldPerformMajorCompaction(Collection<StoreFile> filesToCompact) throws IOException
shouldPerformMajorCompaction
in class SortedCompactionPolicy
filesToCompact
- Files to compact. Can be null.IOException
protected CompactionRequest createCompactionRequest(ArrayList<StoreFile> candidateSelection, boolean tryingMajor, boolean mayUseOffPeak, boolean mayBeStuck) throws IOException
createCompactionRequest
in class SortedCompactionPolicy
IOException
protected ArrayList<StoreFile> applyCompactionPolicy(ArrayList<StoreFile> candidates, boolean mayUseOffPeak, boolean mayBeStuck) throws IOException
candidates
- pre-filtrateIOException
public boolean needsCompaction(Collection<StoreFile> storeFiles, List<StoreFile> filesCompacting)
needsCompaction
in class SortedCompactionPolicy
storeFiles
- files in the store.filesCompacting
- files being scheduled to compact.public void setMinThreshold(int minThreshold)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.