org.compass.needle.terracotta
Class TerracottaDirectoryStore

java.lang.Object
  extended by org.compass.core.lucene.engine.store.AbstractDirectoryStore
      extended by org.compass.needle.terracotta.TerracottaDirectoryStore
All Implemented Interfaces:
CompassConfigurable, DirectoryStore

public class TerracottaDirectoryStore
extends AbstractDirectoryStore
implements CompassConfigurable

A Compass direcoty store that will use the TerracottaDirectory (or one of its sub classes).

Author:
kimchy

Field Summary
static String BUFFER_SIZE_PROP
           
static String CHM_CONCURRENCY_LEVEL_PROP
           
static String CHM_INITIAL_CAPACITY_PROP
           
static String CHM_LOAD_FACTOR_PROP
           
static String CONCURRENT
          Should operations performed within a single "Compass transaction" be performed in a concurrent manner.
static String FLUSH_RATE_PROP
           
static String PROTOCOL
           
static String TYPE
          Allows to control which type of terracotta store will be used.
 
Fields inherited from class org.compass.core.lucene.engine.store.AbstractDirectoryStore
log
 
Constructor Summary
TerracottaDirectoryStore()
           
 
Method Summary
 CopyFromHolder beforeCopyFrom(String subContext, String subIndex, Directory dir)
           
 void cleanIndex(Directory dir, String subContext, String subIndex)
          If applicable, cleans the given directory.
 void configure(CompassSettings settings)
          Configure using the given settings.
 void deleteIndex(Directory dir, String subContext, String subIndex)
          If applicable, deletes the given directory.
 String[] listSubIndexes(String subContext)
          Lists all the sub indexes for the given sub context.
 Directory open(String subContext, String subIndex)
          Opens a new Directory for the given sub context and sub index.
 void registerEventListeners(SearchEngine searchEngine, SearchEngineEventManager eventManager)
           
 boolean requiresAsyncTransactionalContext()
          By default, stores do not require transactional context.
 String suggestedIndexDeletionPolicy()
          By default, return null which means let globabl settings to decide what the default index deletion policy should be.
 boolean supportsConcurrentCommits()
          By default, stores support concurrent commits.
 boolean supportsConcurrentOperations()
          By defualt, stores support concurrent operations (return true).
 
Methods inherited from class org.compass.core.lucene.engine.store.AbstractDirectoryStore
afterFailedCopyFrom, afterSuccessfulCopyFrom, close, closeDirectory, indexExists, performScheduledTasks, suggestedUseCompoundFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTOCOL

public static final String PROTOCOL
See Also:
Constant Field Values

BUFFER_SIZE_PROP

public static final String BUFFER_SIZE_PROP
See Also:
TerracottaDirectory.DEFAULT_BUFFER_SIZE, Constant Field Values

FLUSH_RATE_PROP

public static final String FLUSH_RATE_PROP
See Also:
TerracottaDirectory.DEFAULT_FLUSH_RATE, Constant Field Values

CHM_INITIAL_CAPACITY_PROP

public static final String CHM_INITIAL_CAPACITY_PROP
See Also:
TerracottaDirectory.DEFAULT_CHM_INITIAL_CAPACITY, Constant Field Values

CHM_LOAD_FACTOR_PROP

public static final String CHM_LOAD_FACTOR_PROP
See Also:
TerracottaDirectory.DEFAULT_CHM_LOAD_FACTOR, Constant Field Values

CHM_CONCURRENCY_LEVEL_PROP

public static final String CHM_CONCURRENCY_LEVEL_PROP
See Also:
TerracottaDirectory.DEFAULT_CHM_CONCURRENCY_LEVEL, Constant Field Values

TYPE

public static final String TYPE
Allows to control which type of terracotta store will be used. Options are:

See Also:
Constant Field Values

CONCURRENT

public static final String CONCURRENT
Should operations performed within a single "Compass transaction" be performed in a concurrent manner. The concurrent operations are jobs (create/update/delete) and commit (per sub index).

See Also:
Constant Field Values
Constructor Detail

TerracottaDirectoryStore

public TerracottaDirectoryStore()
Method Detail

configure

public void configure(CompassSettings settings)
               throws CompassException
Description copied from interface: CompassConfigurable
Configure using the given settings.

Specified by:
configure in interface CompassConfigurable
Parameters:
settings - The settings for the configured object
Throws:
CompassException

open

public Directory open(String subContext,
                      String subIndex)
               throws SearchEngineException
Description copied from interface: DirectoryStore
Opens a new Directory for the given sub context and sub index.

Specified by:
open in interface DirectoryStore
Throws:
SearchEngineException

cleanIndex

public void cleanIndex(Directory dir,
                       String subContext,
                       String subIndex)
                throws SearchEngineException
Description copied from interface: DirectoryStore
If applicable, cleans the given directory. Notes, this will be called right before the directory will be closed. And then a create index will be done.

Specified by:
cleanIndex in interface DirectoryStore
Overrides:
cleanIndex in class AbstractDirectoryStore
Throws:
SearchEngineException

deleteIndex

public void deleteIndex(Directory dir,
                        String subContext,
                        String subIndex)
                 throws SearchEngineException
Description copied from interface: DirectoryStore
If applicable, deletes the given directory.

Specified by:
deleteIndex in interface DirectoryStore
Overrides:
deleteIndex in class AbstractDirectoryStore
Throws:
SearchEngineException

listSubIndexes

public String[] listSubIndexes(String subContext)
                        throws SearchEngineException,
                               UnsupportedOperationException
Description copied from interface: DirectoryStore
Lists all the sub indexes for the given sub context. Retruns null if the sub context directory does not even exists.

Throws an UnsupportedOperationException when the directory store does not support listing sub indexes.

Specified by:
listSubIndexes in interface DirectoryStore
Overrides:
listSubIndexes in class AbstractDirectoryStore
Throws:
SearchEngineException
UnsupportedOperationException

beforeCopyFrom

public CopyFromHolder beforeCopyFrom(String subContext,
                                     String subIndex,
                                     Directory dir)
                              throws SearchEngineException
Specified by:
beforeCopyFrom in interface DirectoryStore
Overrides:
beforeCopyFrom in class AbstractDirectoryStore
Throws:
SearchEngineException

suggestedIndexDeletionPolicy

public String suggestedIndexDeletionPolicy()
Description copied from class: AbstractDirectoryStore
By default, return null which means let globabl settings to decide what the default index deletion policy should be.

Specified by:
suggestedIndexDeletionPolicy in interface DirectoryStore
Overrides:
suggestedIndexDeletionPolicy in class AbstractDirectoryStore

supportsConcurrentCommits

public boolean supportsConcurrentCommits()
Description copied from class: AbstractDirectoryStore
By default, stores support concurrent commits.

Specified by:
supportsConcurrentCommits in interface DirectoryStore
Overrides:
supportsConcurrentCommits in class AbstractDirectoryStore

supportsConcurrentOperations

public boolean supportsConcurrentOperations()
Description copied from class: AbstractDirectoryStore
By defualt, stores support concurrent operations (return true).

Specified by:
supportsConcurrentOperations in interface DirectoryStore
Overrides:
supportsConcurrentOperations in class AbstractDirectoryStore

requiresAsyncTransactionalContext

public boolean requiresAsyncTransactionalContext()
Description copied from class: AbstractDirectoryStore
By default, stores do not require transactional context.

Specified by:
requiresAsyncTransactionalContext in interface DirectoryStore
Overrides:
requiresAsyncTransactionalContext in class AbstractDirectoryStore

registerEventListeners

public void registerEventListeners(SearchEngine searchEngine,
                                   SearchEngineEventManager eventManager)
Specified by:
registerEventListeners in interface DirectoryStore
Overrides:
registerEventListeners in class AbstractDirectoryStore


Copyright (c) 2004-2009 The Compass Project.