org.apache.hadoop.hbase.regionserver
Class StoreEngine<SF extends org.apache.hadoop.hbase.regionserver.StoreFlusher,CP extends CompactionPolicy,C extends Compactor,SFM extends StoreFileManager>

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.StoreEngine<SF,CP,C,SFM>
Direct Known Subclasses:
DateTieredStoreEngine, DefaultStoreEngine, StripeStoreEngine

@InterfaceAudience.Private
public abstract class StoreEngine<SF extends org.apache.hadoop.hbase.regionserver.StoreFlusher,CP extends CompactionPolicy,C extends Compactor,SFM extends StoreFileManager>
extends Object

StoreEngine is a factory that can create the objects necessary for HStore to operate. Since not all compaction policies, compactors and store file managers are compatible, they are tied together and replaced together via StoreEngine-s.


Field Summary
protected  CP compactionPolicy
           
protected  C compactor
           
static String STORE_ENGINE_CLASS_KEY
          The name of the configuration parameter that specifies the class of a store engine that is used to manage and compact HBase store files.
protected  SFM storeFileManager
           
protected  SF storeFlusher
           
 
Constructor Summary
StoreEngine()
           
 
Method Summary
static StoreEngine<?,?,?,?> create(Store store, org.apache.hadoop.conf.Configuration conf, KeyValue.KVComparator kvComparator)
          Create the StoreEngine configured for the given Store.
abstract  CompactionContext createCompaction()
          Creates an instance of a compaction context specific to this engine.
protected abstract  void createComponents(org.apache.hadoop.conf.Configuration conf, Store store, KeyValue.KVComparator kvComparator)
          Create the StoreEngine's components.
 CompactionPolicy getCompactionPolicy()
           
 Compactor getCompactor()
           
 StoreFileManager getStoreFileManager()
           
 org.apache.hadoop.hbase.regionserver.StoreFlusher getStoreFlusher()
           
abstract  boolean needsCompaction(List<StoreFile> filesCompacting)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

storeFlusher

protected SF extends org.apache.hadoop.hbase.regionserver.StoreFlusher storeFlusher

compactionPolicy

protected CP extends CompactionPolicy compactionPolicy

compactor

protected C extends Compactor compactor

storeFileManager

protected SFM extends StoreFileManager storeFileManager

STORE_ENGINE_CLASS_KEY

public static final String STORE_ENGINE_CLASS_KEY
The name of the configuration parameter that specifies the class of a store engine that is used to manage and compact HBase store files.

See Also:
Constant Field Values
Constructor Detail

StoreEngine

public StoreEngine()
Method Detail

getCompactionPolicy

public CompactionPolicy getCompactionPolicy()
Returns:
Compaction policy to use.

getCompactor

public Compactor getCompactor()
Returns:
Compactor to use.

getStoreFileManager

public StoreFileManager getStoreFileManager()
Returns:
Store file manager to use.

getStoreFlusher

public org.apache.hadoop.hbase.regionserver.StoreFlusher getStoreFlusher()
Returns:
Store flusher to use.

needsCompaction

public abstract boolean needsCompaction(List<StoreFile> filesCompacting)
Parameters:
filesCompacting - Files currently compacting
Returns:
whether a compaction selection is possible

createCompaction

public abstract CompactionContext createCompaction()
                                            throws IOException
Creates an instance of a compaction context specific to this engine. Doesn't actually select or start a compaction. See CompactionContext class comment.

Returns:
New CompactionContext object.
Throws:
IOException

createComponents

protected abstract void createComponents(org.apache.hadoop.conf.Configuration conf,
                                         Store store,
                                         KeyValue.KVComparator kvComparator)
                                  throws IOException
Create the StoreEngine's components.

Throws:
IOException

create

public static StoreEngine<?,?,?,?> create(Store store,
                                          org.apache.hadoop.conf.Configuration conf,
                                          KeyValue.KVComparator kvComparator)
                                   throws IOException
Create the StoreEngine configured for the given Store.

Parameters:
store - The store. An unfortunate dependency needed due to it being passed to coprocessors via the compactor.
conf - Store configuration.
kvComparator - KVComparator for storeFileManager.
Returns:
StoreEngine to use.
Throws:
IOException


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