org.compass.core.lucene.engine.store
Class FSDirectoryStore

java.lang.Object
  extended by org.compass.core.lucene.engine.store.AbstractDirectoryStore
      extended by org.compass.core.lucene.engine.store.FSDirectoryStore
All Implemented Interfaces:
CompassConfigurable, DirectoryStore
Direct Known Subclasses:
MMapDirectoryStore, NIOFSDirectoryStore

public class FSDirectoryStore
extends AbstractDirectoryStore
implements CompassConfigurable

A directory store implemented using a file system. Uses Lucene FSDirectory.

Author:
kimchy

Field Summary
static String PROTOCOL
           
 
Constructor Summary
FSDirectoryStore()
           
 
Method Summary
 void afterFailedCopyFrom(String subContext, CopyFromHolder holder)
           
 void afterSuccessfulCopyFrom(String subContext, String subIndex, CopyFromHolder holder)
           
 CopyFromHolder beforeCopyFrom(String subContext, String subIndex, Directory dir)
           
protected  String buildPath(String subContext, String subIndex)
           
 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.
protected  String findIndexPath(String connection)
           
protected  String getFSDirectoryClass()
           
 Directory open(String subContext, String subIndex)
          Opens a new Directory for the given sub context and sub index.
 boolean suggestedUseCompoundFile()
          By default, stores should not use compound file format.
 
Methods inherited from class org.compass.core.lucene.engine.store.AbstractDirectoryStore
afterFailedCopyFrom, close, closeDirectory, indexExists, performScheduledTasks, registerEventListeners, requiresAsyncTransactionalContext, suggestedIndexDeletionPolicy, supportsConcurrentOperations
 
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
Constructor Detail

FSDirectoryStore

public FSDirectoryStore()
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

findIndexPath

protected String findIndexPath(String connection)

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

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

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

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

afterSuccessfulCopyFrom

public void afterSuccessfulCopyFrom(String subContext,
                                    String subIndex,
                                    CopyFromHolder holder)
                             throws SearchEngineException
Specified by:
afterSuccessfulCopyFrom in interface DirectoryStore
Overrides:
afterSuccessfulCopyFrom in class AbstractDirectoryStore
Throws:
SearchEngineException

afterFailedCopyFrom

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

buildPath

protected String buildPath(String subContext,
                           String subIndex)

suggestedUseCompoundFile

public boolean suggestedUseCompoundFile()
Description copied from class: AbstractDirectoryStore
By default, stores should not use compound file format.

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

getFSDirectoryClass

protected String getFSDirectoryClass()


Copyright (c) 2004-2008 The Compass Project.