org.compass.core.lucene.engine.store
Interface DirectoryStore

All Known Implementing Classes:
AbstractCoherenceDirectoryStore, AbstractDirectoryStore, DataGridCoherenceDirectoryStore, FSDirectoryStore, GigaSpaceDirectoryStore, InvocableCoherenceDirectoryStore, JdbcDirectoryStore, MMapDirectoryStore, NIOFSDirectoryStore, RAMDirectoryStore, TerracottaDirectoryStore

public interface DirectoryStore

An abstraction on top of Lucene Directory handling.

Author:
kimchy

Method Summary
 void afterFailedCopyFrom(String subContext, String subIndex, CopyFromHolder holder)
           
 void afterSuccessfulCopyFrom(String subContext, String subIndex, CopyFromHolder holder)
           
 CopyFromHolder beforeCopyFrom(String subContext, String subIndex, Directory dir)
           
 void cleanIndex(Directory dir, String subContext, String subIndex)
          If applicable, cleans the given directory.
 void close()
          Closes the given directory.
 void closeDirectory(Directory dir, String subContext, String subIndex)
          Closes the given directory.
 void deleteIndex(Directory dir, String subContext, String subIndex)
          If applicable, deletes the given directory.
 Boolean indexExists(Directory dir)
          Returns true if the inex exists, false if it does not.
 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 performScheduledTasks(Directory dir, String subContext, String subIndex)
          Perform any scheduled tasks that are needed on the given directory.
 void registerEventListeners(SearchEngine searchEngine, SearchEngineEventManager eventManager)
           
 boolean requiresAsyncTransactionalContext()
          Returns true if a transaction needs to be started when performing operations with this store.
 String suggestedIndexDeletionPolicy()
          Returns the suggested index deletion policy for the given store.
 boolean suggestedUseCompoundFile()
          Returns the suggested compound file format usage.
 boolean supportsConcurrentCommits()
          Retruns true if this store supports concurrent commits.
 boolean supportsConcurrentOperations()
          Returns true if this store supports concurrent operations.
 

Method Detail

open

Directory open(String subContext,
               String subIndex)
               throws SearchEngineException
Opens a new Directory for the given sub context and sub index.

Throws:
SearchEngineException

listSubIndexes

String[] listSubIndexes(String subContext)
                        throws SearchEngineException,
                               UnsupportedOperationException
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.

Throws:
SearchEngineException
UnsupportedOperationException

indexExists

Boolean indexExists(Directory dir)
                    throws SearchEngineException
Returns true if the inex exists, false if it does not. Can return null which then will cause the default checking to apply.

Throws:
SearchEngineException

deleteIndex

void deleteIndex(Directory dir,
                 String subContext,
                 String subIndex)
                 throws SearchEngineException
If applicable, deletes the given directory.

Throws:
SearchEngineException

cleanIndex

void cleanIndex(Directory dir,
                String subContext,
                String subIndex)
                throws SearchEngineException
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.

Throws:
SearchEngineException

closeDirectory

void closeDirectory(Directory dir,
                    String subContext,
                    String subIndex)
                    throws SearchEngineException
Closes the given directory.

Throws:
SearchEngineException

performScheduledTasks

void performScheduledTasks(Directory dir,
                           String subContext,
                           String subIndex)
                           throws SearchEngineException
Perform any scheduled tasks that are needed on the given directory.

Throws:
SearchEngineException

beforeCopyFrom

CopyFromHolder beforeCopyFrom(String subContext,
                              String subIndex,
                              Directory dir)
                              throws SearchEngineException
Throws:
SearchEngineException

afterSuccessfulCopyFrom

void afterSuccessfulCopyFrom(String subContext,
                             String subIndex,
                             CopyFromHolder holder)
                             throws SearchEngineException
Throws:
SearchEngineException

afterFailedCopyFrom

void afterFailedCopyFrom(String subContext,
                         String subIndex,
                         CopyFromHolder holder)
                         throws SearchEngineException
Throws:
SearchEngineException

registerEventListeners

void registerEventListeners(SearchEngine searchEngine,
                            SearchEngineEventManager eventManager)

close

void close()
Closes the given directory.


requiresAsyncTransactionalContext

boolean requiresAsyncTransactionalContext()
Returns true if a transaction needs to be started when performing operations with this store.


suggestedUseCompoundFile

boolean suggestedUseCompoundFile()
Returns the suggested compound file format usage.


supportsConcurrentOperations

boolean supportsConcurrentOperations()
Returns true if this store supports concurrent operations.


supportsConcurrentCommits

boolean supportsConcurrentCommits()
Retruns true if this store supports concurrent commits. If set to true, commits will be perfomed on different threads concurrently.


suggestedIndexDeletionPolicy

String suggestedIndexDeletionPolicy()
Returns the suggested index deletion policy for the given store. Will be applied if not explicitly configured. Can return null if globabl settings should be applied.



Copyright (c) 2004-2009 The Compass Project.