org.apache.hadoop.hbase.regionserver.compactions
Class ExploringCompactionPolicy

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.compactions.CompactionPolicy
      extended by org.apache.hadoop.hbase.regionserver.compactions.SortedCompactionPolicy
          extended by org.apache.hadoop.hbase.regionserver.compactions.RatioBasedCompactionPolicy
              extended by org.apache.hadoop.hbase.regionserver.compactions.ExploringCompactionPolicy
Direct Known Subclasses:
FIFOCompactionPolicy

@InterfaceAudience.Private
public class ExploringCompactionPolicy
extends RatioBasedCompactionPolicy

Class to pick which files if any to compact together. This class will search all possibilities for different and if it gets stuck it will choose the smallest set of files to compact.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.regionserver.compactions.CompactionPolicy
comConf, storeConfigInfo
 
Constructor Summary
ExploringCompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
          Constructor for ExploringCompactionPolicy.
 
Method Summary
protected  ArrayList<StoreFile> applyCompactionPolicy(ArrayList<StoreFile> candidates, boolean mayUseOffPeak, boolean mightBeStuck)
           
 List<StoreFile> applyCompactionPolicy(List<StoreFile> candidates, boolean mightBeStuck, boolean mayUseOffPeak, int minFiles, int maxFiles)
           
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.compactions.RatioBasedCompactionPolicy
getCompactionRequest, setMinThreshold, shouldPerformMajorCompaction
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.compactions.SortedCompactionPolicy
checkMinFilesCriteria, filterBulk, getCurrentEligibleFiles, getNextMajorCompactTime, needsCompaction, preSelectCompactionForCoprocessor, removeExcessFiles, selectCompaction, skipLargeFiles, throttleCompaction
 
Methods inherited from class org.apache.hadoop.hbase.regionserver.compactions.CompactionPolicy
getConf, setConf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExploringCompactionPolicy

public ExploringCompactionPolicy(org.apache.hadoop.conf.Configuration conf,
                                 StoreConfigInformation storeConfigInfo)
Constructor for ExploringCompactionPolicy.

Parameters:
conf - The configuration object
storeConfigInfo - An object to provide info about the store.
Method Detail

applyCompactionPolicy

protected final ArrayList<StoreFile> applyCompactionPolicy(ArrayList<StoreFile> candidates,
                                                           boolean mayUseOffPeak,
                                                           boolean mightBeStuck)
                                                    throws IOException
Overrides:
applyCompactionPolicy in class RatioBasedCompactionPolicy
Parameters:
candidates - pre-filtrate
Returns:
filtered subset -- Default minor compaction selection algorithm: choose CompactSelection from candidates -- First exclude bulk-load files if indicated in configuration. Start at the oldest file and stop when you find the first file that meets compaction criteria: (1) a recently-flushed, small file (i.e. <= minCompactSize) OR (2) within the compactRatio of sum(newer_files) Given normal skew, any newer files will also meet this criteria

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 | | | | | | | | _ | | | | | | | | | | | | | | | | | | | | | | | | | |

Throws:
IOException

applyCompactionPolicy

public List<StoreFile> applyCompactionPolicy(List<StoreFile> candidates,
                                             boolean mightBeStuck,
                                             boolean mayUseOffPeak,
                                             int minFiles,
                                             int maxFiles)


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.