@InterfaceAudience.Private public class RatioBasedCompactionPolicy extends SortedCompactionPolicy
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
comConf, storeConfigInfo
Constructor and Description |
---|
RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo) |
Modifier and Type | Method and Description |
---|---|
protected ArrayList<HStoreFile> |
applyCompactionPolicy(ArrayList<HStoreFile> candidates,
boolean mayUseOffPeak,
boolean mayBeStuck)
-- Default minor compaction selection algorithm:
choose CompactSelection from candidates --
First exclude bulk-load files if indicated in configuration.
|
protected CompactionRequestImpl |
createCompactionRequest(ArrayList<HStoreFile> candidateSelection,
boolean tryingMajor,
boolean mayUseOffPeak,
boolean mayBeStuck) |
boolean |
needsCompaction(Collection<HStoreFile> storeFiles,
List<HStoreFile> filesCompacting)
A heuristic method to decide whether to schedule a compaction request
|
void |
setMinThreshold(int minThreshold)
Overwrite min threshold for compaction
|
boolean |
shouldPerformMajorCompaction(Collection<HStoreFile> filesToCompact) |
checkMinFilesCriteria, filterBulk, getCurrentEligibleFiles, getNextMajorCompactTime, preSelectCompactionForCoprocessor, removeExcessFiles, selectCompaction, skipLargeFiles, throttleCompaction
getConf, setConf
private static final org.slf4j.Logger LOG
public RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
public boolean shouldPerformMajorCompaction(Collection<HStoreFile> filesToCompact) throws IOException
shouldPerformMajorCompaction
in class SortedCompactionPolicy
filesToCompact
- Files to compact. Can be null.IOException
protected CompactionRequestImpl createCompactionRequest(ArrayList<HStoreFile> candidateSelection, boolean tryingMajor, boolean mayUseOffPeak, boolean mayBeStuck) throws IOException
createCompactionRequest
in class SortedCompactionPolicy
IOException
protected ArrayList<HStoreFile> applyCompactionPolicy(ArrayList<HStoreFile> candidates, boolean mayUseOffPeak, boolean mayBeStuck) throws IOException
Additional Note: If fileSizes.size() >> maxFilesToCompact, we will recurse on compact(). Consider the oldest files first to avoid a situation where we always compact [end-threshold,end). Then, the last file becomes an aggregate of the previous compactions. normal skew: older ----> newer (increasing seqID) _ | | _ | | | | _ --|-|- |-|- |-|---_-------_------- minCompactSize | | | | | | | | _ | | | | | | | | | | | | | | | | | | | | | | | | | |
candidates
- pre-filtrateIOException
public boolean needsCompaction(Collection<HStoreFile> storeFiles, List<HStoreFile> filesCompacting)
needsCompaction
in class SortedCompactionPolicy
storeFiles
- files in the store.filesCompacting
- files being scheduled to compact.public void setMinThreshold(int minThreshold)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.