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

java.lang.Object
  extended by org.compass.core.lucene.engine.store.AbstractDirectoryStore
      extended by org.compass.core.lucene.engine.store.RAMDirectoryStore
All Implemented Interfaces:
DirectoryStore

public class RAMDirectoryStore
extends AbstractDirectoryStore

A directory store implemented using memory. Uses Lucene RAMDirectory.

Author:
kimchy

Field Summary
static String PROTOCOL
           
 
Fields inherited from class org.compass.core.lucene.engine.store.AbstractDirectoryStore
log
 
Constructor Summary
RAMDirectoryStore()
           
 
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 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.
 
Methods inherited from class org.compass.core.lucene.engine.store.AbstractDirectoryStore
afterFailedCopyFrom, afterSuccessfulCopyFrom, close, closeDirectory, indexExists, performScheduledTasks, registerEventListeners, requiresAsyncTransactionalContext, suggestedIndexDeletionPolicy, suggestedUseCompoundFile, supportsConcurrentCommits, 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

RAMDirectoryStore

public RAMDirectoryStore()
Method Detail

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.

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


Copyright (c) 2004-2009 The Compass Project.