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

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.compactions.CompactionPolicy
Direct Known Subclasses:
RatioBasedCompactionPolicy, StripeCompactionPolicy

@InterfaceAudience.Private
public abstract class CompactionPolicy
extends Object

A compaction policy determines how to select files for compaction, how to compact them, and how to generate the compacted files.


Field Summary
protected  CompactionConfiguration comConf
           
protected  StoreConfigInformation storeConfigInfo
           
 
Constructor Summary
CompactionPolicy(org.apache.hadoop.conf.Configuration conf, StoreConfigInformation storeConfigInfo)
           
 
Method Summary
 CompactionConfiguration getConf()
           
abstract  boolean isMajorCompaction(Collection<StoreFile> filesToCompact)
           
 void setConf(org.apache.hadoop.conf.Configuration conf)
          Inform the policy that some configuration has been change, so cached value should be updated it any.
abstract  boolean throttleCompaction(long compactionSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comConf

protected CompactionConfiguration comConf

storeConfigInfo

protected StoreConfigInformation storeConfigInfo
Constructor Detail

CompactionPolicy

public CompactionPolicy(org.apache.hadoop.conf.Configuration conf,
                        StoreConfigInformation storeConfigInfo)
Method Detail

isMajorCompaction

public abstract boolean isMajorCompaction(Collection<StoreFile> filesToCompact)
                                   throws IOException
Parameters:
filesToCompact - Files to compact. Can be null.
Returns:
True if we should run a major compaction.
Throws:
IOException

throttleCompaction

public abstract boolean throttleCompaction(long compactionSize)
Parameters:
compactionSize - Total size of some compaction
Returns:
whether this should be a large or small compaction

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Inform the policy that some configuration has been change, so cached value should be updated it any.


getConf

public CompactionConfiguration getConf()


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