org.apache.hadoop.hbase.regionserver.compactions
Class DefaultCompactionPolicy
java.lang.Object
org.apache.hadoop.hbase.regionserver.compactions.CompactionPolicy
org.apache.hadoop.hbase.regionserver.compactions.DefaultCompactionPolicy
@InterfaceAudience.Private
public class DefaultCompactionPolicy
- extends CompactionPolicy
The default algorithm for selecting files for compaction.
Combines the compaction configuration and the provisional file selection that
it's given to produce the list of suitable candidates for compaction.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultCompactionPolicy
public DefaultCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
StoreConfigInformation storeConfigInfo)
preSelectCompactionForCoprocessor
public List<StoreFile> preSelectCompactionForCoprocessor(Collection<StoreFile> candidates,
List<StoreFile> filesCompacting)
selectCompaction
public CompactionRequest selectCompaction(Collection<StoreFile> candidateFiles,
List<StoreFile> filesCompacting,
boolean isUserCompaction,
boolean mayUseOffPeak,
boolean forceMajor)
throws IOException
- Parameters:
candidateFiles
- candidate files, ordered from oldest to newest
- Returns:
- subset copy of candidate list that meets compaction criteria
- Throws:
IOException
isMajorCompaction
public boolean isMajorCompaction(Collection<StoreFile> filesToCompact)
throws IOException
- Specified by:
isMajorCompaction
in class CompactionPolicy
- Parameters:
filesToCompact
- Files to compact. Can be null.
- Returns:
- True if we should run a major compaction.
- Throws:
IOException
getNextMajorCompactTime
public long getNextMajorCompactTime(Collection<StoreFile> filesToCompact)
throttleCompaction
public boolean throttleCompaction(long compactionSize)
- Specified by:
throttleCompaction
in class CompactionPolicy
- Parameters:
compactionSize
- Total size of some compaction
- Returns:
- whether this should be a large or small compaction
needsCompaction
public boolean needsCompaction(Collection<StoreFile> storeFiles,
List<StoreFile> filesCompacting)
- Specified by:
needsCompaction
in class CompactionPolicy
- Parameters:
storeFiles
- Current store files.filesCompacting
- files currently compacting.
- Returns:
- whether a compactionSelection is possible
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.