org.sakaiproject.search.index
Interface IndexStorage

All Superinterfaces:
Diagnosable
All Known Implementing Classes:
BaseIndexStorage, ClusterFSIndexStorage, FSIndexStorage, ParallelIndexStorage, SearchIndexStorage

public interface IndexStorage
extends Diagnosable

Defines the IndexStorage mechanism used

Author:
ieb

Method Summary
 void addReloadListener(IndexReloadListener indexReloadListener)
           
 boolean centralIndexExists()
          A fast method that checks if the index exists in the cluster without opening or loading the index.
 void closeIndexReader(org.apache.lucene.index.IndexReader indexReader)
          This will close the index reader and release any locks
 void closeIndexSearcher(org.apache.lucene.search.IndexSearcher oldRunningIndexSearcher)
           
 void closeIndexWriter(org.apache.lucene.index.IndexWriter indexWrite)
          this will close the index reader and release any locks
 void doPostIndexUpdate()
          perform all operations necessary after an update cycle
 void doPreIndexUpdate()
          perform all operations before an update cycle
 void forceNextReload()
           
 org.apache.lucene.analysis.Analyzer getAnalyzer()
          Get an analyzer correct for the indexer being used.
 org.apache.lucene.index.IndexReader getIndexReader()
          get an Index Reader for the IndexStorage type
 org.apache.lucene.search.IndexSearcher getIndexSearcher(boolean reload)
          get an index searcher
 org.apache.lucene.index.IndexWriter getIndexWriter(boolean create)
          get an index writer, and create if asked to
 long getLastLoad()
          When the index was last loaded
 long getLastLoadTime()
          The ammount of time (ms) that it took to load the index last time
 long getLastUpdate()
           
 List getSegmentInfoList()
           
 org.apache.lucene.store.Directory getSpellDirectory()
          get the spell index directory
 boolean indexExists()
          Does the index exist
 boolean isMultipleIndexers()
          Returns true if its ok to allow multiple indexers to run at the same time The index storage may manage its own locks.
 void removeReloadListener(IndexReloadListener indexReloadListener)
           
 void setRecoverCorruptedIndex(boolean recover)
          if set to true the IndexStorageWill automatically attempt to recover a corrupted index Not all IndexStorage implementations can do this,
 
Methods inherited from interface org.sakaiproject.search.api.Diagnosable
disableDiagnostics, enableDiagnostics, hasDiagnostics
 

Method Detail

getIndexReader

org.apache.lucene.index.IndexReader getIndexReader()
                                                   throws IOException
get an Index Reader for the IndexStorage type

Returns:
Throws:
IOException

getIndexWriter

org.apache.lucene.index.IndexWriter getIndexWriter(boolean create)
                                                   throws IOException
get an index writer, and create if asked to

Parameters:
create -
Returns:
Throws:
IOException

getIndexSearcher

org.apache.lucene.search.IndexSearcher getIndexSearcher(boolean reload)
                                                        throws IOException
get an index searcher

Parameters:
reload - force a reload of the searcher, if the implementation is caching a searcher
Returns:
Throws:
IOException

doPostIndexUpdate

void doPostIndexUpdate()
                       throws IOException
perform all operations necessary after an update cycle

Throws:
IOException

doPreIndexUpdate

void doPreIndexUpdate()
                      throws IOException
perform all operations before an update cycle

Throws:
IOException

indexExists

boolean indexExists()
Does the index exist

Returns:

getAnalyzer

org.apache.lucene.analysis.Analyzer getAnalyzer()
Get an analyzer correct for the indexer being used.

Returns:

setRecoverCorruptedIndex

void setRecoverCorruptedIndex(boolean recover)
if set to true the IndexStorageWill automatically attempt to recover a corrupted index Not all IndexStorage implementations can do this,


getLastUpdate

long getLastUpdate()

getSegmentInfoList

List getSegmentInfoList()

closeIndexReader

void closeIndexReader(org.apache.lucene.index.IndexReader indexReader)
                      throws IOException
This will close the index reader and release any locks

Parameters:
indexReader -
Throws:
IOException

closeIndexWriter

void closeIndexWriter(org.apache.lucene.index.IndexWriter indexWrite)
                      throws IOException
this will close the index reader and release any locks

Parameters:
indexWrite -
Throws:
IOException

isMultipleIndexers

boolean isMultipleIndexers()
Returns true if its ok to allow multiple indexers to run at the same time The index storage may manage its own locks.

Returns:

closeIndexSearcher

void closeIndexSearcher(org.apache.lucene.search.IndexSearcher oldRunningIndexSearcher)

centralIndexExists

boolean centralIndexExists()
A fast method that checks if the index exists in the cluster without opening or loading the index. Is local, looking on local disk is enough.

Returns:

getLastLoad

long getLastLoad()
When the index was last loaded

Returns:

getLastLoadTime

long getLastLoadTime()
The ammount of time (ms) that it took to load the index last time

Returns:

addReloadListener

void addReloadListener(IndexReloadListener indexReloadListener)
Parameters:
indexReloadListener -

removeReloadListener

void removeReloadListener(IndexReloadListener indexReloadListener)
Parameters:
indexReloadListener -

forceNextReload

void forceNextReload()

getSpellDirectory

org.apache.lucene.store.Directory getSpellDirectory()
get the spell index directory

Returns:


Copyright © 2003-2012 Sakai Project. All Rights Reserved.