@InterfaceAudience.LimitedPrivate(value="Configuration") public class DateTieredCompactionPolicy extends SortedCompactionPolicy
Modifier and Type | Field and Description |
---|---|
private RatioBasedCompactionPolicy |
compactionPolicyPerWindow |
private static org.slf4j.Logger |
LOG |
private CompactionWindowFactory |
windowFactory |
comConf, storeConfigInfo
Constructor and Description |
---|
DateTieredCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo) |
Modifier and Type | Method and Description |
---|---|
protected CompactionRequestImpl |
createCompactionRequest(ArrayList<HStoreFile> candidateSelection,
boolean tryingMajor,
boolean mayUseOffPeak,
boolean mayBeStuck) |
private DateTieredCompactionRequest |
generateCompactionRequest(ArrayList<HStoreFile> storeFiles,
CompactionWindow window,
boolean mayUseOffPeak,
boolean mayBeStuck,
int minThreshold,
long now) |
private Map<Long,String> |
getBoundariesStoragePolicyForMajor(List<Long> boundaries,
long now) |
private Map<Long,String> |
getBoundariesStoragePolicyForMinor(boolean singleOutput,
CompactionWindow window,
long now) |
private List<Long> |
getCompactBoundariesForMajor(Collection<HStoreFile> filesToCompact,
long now)
Return a list of boundaries for multiple compaction output in ascending order.
|
private static List<Long> |
getCompactionBoundariesForMinor(CompactionWindow window,
boolean singleOutput)
Returns a list of boundaries for multiple compaction output from minTimestamp to maxTimestamp.
|
private CompactionWindow |
getIncomingWindow(long now) |
private static long |
getOldestToCompact(long maxAgeMillis,
long now) |
private String |
getWindowStoragePolicy(long now,
long windowStartMillis) |
boolean |
needsCompaction(Collection<HStoreFile> storeFiles,
List<HStoreFile> filesCompacting)
Heuristics for guessing whether we need minor compaction.
|
CompactionRequestImpl |
selectMajorCompaction(ArrayList<HStoreFile> candidateSelection) |
CompactionRequestImpl |
selectMinorCompaction(ArrayList<HStoreFile> candidateSelection,
boolean mayUseOffPeak,
boolean mayBeStuck)
We receive store files sorted in ascending order by seqId then scan the list of files.
|
boolean |
shouldPerformMajorCompaction(Collection<HStoreFile> filesToCompact) |
checkMinFilesCriteria, filterBulk, getCurrentEligibleFiles, getNextMajorCompactTime, preSelectCompactionForCoprocessor, removeExcessFiles, selectCompaction, skipLargeFiles, throttleCompaction
getConf, setConf
private static final org.slf4j.Logger LOG
private final RatioBasedCompactionPolicy compactionPolicyPerWindow
private final CompactionWindowFactory windowFactory
public DateTieredCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo) throws IOException
IOException
@InterfaceAudience.Private public boolean needsCompaction(Collection<HStoreFile> storeFiles, List<HStoreFile> filesCompacting)
needsCompaction
in class SortedCompactionPolicy
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
public CompactionRequestImpl selectMajorCompaction(ArrayList<HStoreFile> candidateSelection)
public CompactionRequestImpl selectMinorCompaction(ArrayList<HStoreFile> candidateSelection, boolean mayUseOffPeak, boolean mayBeStuck) throws IOException
IOException
private DateTieredCompactionRequest generateCompactionRequest(ArrayList<HStoreFile> storeFiles, CompactionWindow window, boolean mayUseOffPeak, boolean mayBeStuck, int minThreshold, long now) throws IOException
IOException
private List<Long> getCompactBoundariesForMajor(Collection<HStoreFile> filesToCompact, long now)
private static List<Long> getCompactionBoundariesForMinor(CompactionWindow window, boolean singleOutput)
private CompactionWindow getIncomingWindow(long now)
private static long getOldestToCompact(long maxAgeMillis, long now)
private Map<Long,String> getBoundariesStoragePolicyForMinor(boolean singleOutput, CompactionWindow window, long now)
private Map<Long,String> getBoundariesStoragePolicyForMajor(List<Long> boundaries, long now)
private String getWindowStoragePolicy(long now, long windowStartMillis)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.