@InterfaceAudience.Private public class RatioBasedCompactionPolicy extends CompactionPolicy
comConf, storeConfigInfo
Constructor and Description |
---|
RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo) |
Modifier and Type | Method and Description |
---|---|
long |
getNextMajorCompactTime(Collection<StoreFile> filesToCompact) |
boolean |
isMajorCompaction(Collection<StoreFile> filesToCompact) |
boolean |
needsCompaction(Collection<StoreFile> storeFiles,
List<StoreFile> filesCompacting) |
List<StoreFile> |
preSelectCompactionForCoprocessor(Collection<StoreFile> candidates,
List<StoreFile> filesCompacting) |
CompactionRequest |
selectCompaction(Collection<StoreFile> candidateFiles,
List<StoreFile> filesCompacting,
boolean isUserCompaction,
boolean mayUseOffPeak,
boolean forceMajor) |
boolean |
throttleCompaction(long compactionSize) |
getConf, setConf
public RatioBasedCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
public List<StoreFile> preSelectCompactionForCoprocessor(Collection<StoreFile> candidates, List<StoreFile> filesCompacting)
public CompactionRequest selectCompaction(Collection<StoreFile> candidateFiles, List<StoreFile> filesCompacting, boolean isUserCompaction, boolean mayUseOffPeak, boolean forceMajor) throws IOException
candidateFiles
- candidate files, ordered from oldest to newest. All files in store.IOException
public boolean isMajorCompaction(Collection<StoreFile> filesToCompact) throws IOException
isMajorCompaction
in class CompactionPolicy
filesToCompact
- Files to compact. Can be null.IOException
public long getNextMajorCompactTime(Collection<StoreFile> filesToCompact)
filesToCompact
- public boolean throttleCompaction(long compactionSize)
throttleCompaction
in class CompactionPolicy
compactionSize
- Total size of some compactionpublic boolean needsCompaction(Collection<StoreFile> storeFiles, List<StoreFile> filesCompacting)
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.