org.sakaiproject.search.journal.impl
Class ParallelIndexStorage

java.lang.Object
  extended by org.sakaiproject.search.journal.impl.ParallelIndexStorage
All Implemented Interfaces:
Diagnosable, IndexStorage

public class ParallelIndexStorage
extends Object
implements IndexStorage

Author:
ieb

Constructor Summary
ParallelIndexStorage()
           
 
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 destroy()
           
 void disableDiagnostics()
           
 void doPostIndexUpdate()
          perform all operations necessary after an update cycle
 void doPreIndexUpdate()
          perform all operations before an update cycle
 void enableDiagnostics()
           
 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
 IndexStorageProvider getIndexStorageProvider()
           
 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<Object[]> getSegmentInfoList()
           
 org.apache.lucene.store.Directory getSpellDirectory()
          get the spell index directory
 boolean hasDiagnostics()
           
 boolean indexExists()
          Does the index exist
 void init()
           
 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 setIndexStorageProvider(IndexStorageProvider indexStorageProvider)
           
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParallelIndexStorage

public ParallelIndexStorage()
Method Detail

init

public void init()

destroy

public void destroy()

addReloadListener

public void addReloadListener(IndexReloadListener indexReloadListener)
Specified by:
addReloadListener in interface IndexStorage

centralIndexExists

public boolean centralIndexExists()
Description copied from interface: IndexStorage
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.

Specified by:
centralIndexExists in interface IndexStorage
Returns:

closeIndexReader

public void closeIndexReader(org.apache.lucene.index.IndexReader indexReader)
                      throws IOException
Description copied from interface: IndexStorage
This will close the index reader and release any locks

Specified by:
closeIndexReader in interface IndexStorage
Throws:
IOException

closeIndexSearcher

public void closeIndexSearcher(org.apache.lucene.search.IndexSearcher oldRunningIndexSearcher)
Specified by:
closeIndexSearcher in interface IndexStorage

closeIndexWriter

public void closeIndexWriter(org.apache.lucene.index.IndexWriter indexWrite)
                      throws IOException
Description copied from interface: IndexStorage
this will close the index reader and release any locks

Specified by:
closeIndexWriter in interface IndexStorage
Throws:
IOException

doPostIndexUpdate

public void doPostIndexUpdate()
                       throws IOException
Description copied from interface: IndexStorage
perform all operations necessary after an update cycle

Specified by:
doPostIndexUpdate in interface IndexStorage
Throws:
IOException

doPreIndexUpdate

public void doPreIndexUpdate()
                      throws IOException
Description copied from interface: IndexStorage
perform all operations before an update cycle

Specified by:
doPreIndexUpdate in interface IndexStorage
Throws:
IOException

forceNextReload

public void forceNextReload()
Specified by:
forceNextReload in interface IndexStorage

getAnalyzer

public org.apache.lucene.analysis.Analyzer getAnalyzer()
Description copied from interface: IndexStorage
Get an analyzer correct for the indexer being used.

Specified by:
getAnalyzer in interface IndexStorage
Returns:

getIndexReader

public org.apache.lucene.index.IndexReader getIndexReader()
                                                   throws IOException
Description copied from interface: IndexStorage
get an Index Reader for the IndexStorage type

Specified by:
getIndexReader in interface IndexStorage
Returns:
Throws:
IOException

getIndexSearcher

public org.apache.lucene.search.IndexSearcher getIndexSearcher(boolean reload)
                                                        throws IOException
Description copied from interface: IndexStorage
get an index searcher

Specified by:
getIndexSearcher in interface IndexStorage
Parameters:
reload - force a reload of the searcher, if the implementation is caching a searcher
Returns:
Throws:
IOException

getIndexWriter

public org.apache.lucene.index.IndexWriter getIndexWriter(boolean create)
                                                   throws IOException
Description copied from interface: IndexStorage
get an index writer, and create if asked to

Specified by:
getIndexWriter in interface IndexStorage
Returns:
Throws:
IOException

getLastLoad

public long getLastLoad()
Description copied from interface: IndexStorage
When the index was last loaded

Specified by:
getLastLoad in interface IndexStorage
Returns:

getLastLoadTime

public long getLastLoadTime()
Description copied from interface: IndexStorage
The ammount of time (ms) that it took to load the index last time

Specified by:
getLastLoadTime in interface IndexStorage
Returns:

getLastUpdate

public long getLastUpdate()
Specified by:
getLastUpdate in interface IndexStorage

getSegmentInfoList

public List<Object[]> getSegmentInfoList()
Specified by:
getSegmentInfoList in interface IndexStorage

indexExists

public boolean indexExists()
Description copied from interface: IndexStorage
Does the index exist

Specified by:
indexExists in interface IndexStorage
Returns:

isMultipleIndexers

public boolean isMultipleIndexers()
Description copied from interface: IndexStorage
Returns true if its ok to allow multiple indexers to run at the same time The index storage may manage its own locks.

Specified by:
isMultipleIndexers in interface IndexStorage
Returns:

removeReloadListener

public void removeReloadListener(IndexReloadListener indexReloadListener)
Specified by:
removeReloadListener in interface IndexStorage

setRecoverCorruptedIndex

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

Specified by:
setRecoverCorruptedIndex in interface IndexStorage

disableDiagnostics

public void disableDiagnostics()
Specified by:
disableDiagnostics in interface Diagnosable

enableDiagnostics

public void enableDiagnostics()
Specified by:
enableDiagnostics in interface Diagnosable

hasDiagnostics

public boolean hasDiagnostics()
Specified by:
hasDiagnostics in interface Diagnosable

getIndexStorageProvider

public IndexStorageProvider getIndexStorageProvider()
Returns:
the indexStorageProvider

setIndexStorageProvider

public void setIndexStorageProvider(IndexStorageProvider indexStorageProvider)
Parameters:
indexStorageProvider - the indexStorageProvider to set

getSpellDirectory

public org.apache.lucene.store.Directory getSpellDirectory()
Description copied from interface: IndexStorage
get the spell index directory

Specified by:
getSpellDirectory in interface IndexStorage
Returns:


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