org.olat.search.service.indexer
Class OlatFullIndexer

java.lang.Object
  extended by org.olat.search.service.indexer.OlatFullIndexer
All Implemented Interfaces:
java.lang.Runnable

public class OlatFullIndexer
extends java.lang.Object
implements java.lang.Runnable

Controls the hole generation of a full-index. Runs in own thread.

Author:
Christian Guretzki

Constructor Summary
OlatFullIndexer(java.lang.String tempIndexPath, Index index, long restartInterval, long indexInterval)
           
 
Method Summary
 void addDocument(org.apache.lucene.document.Document document)
          Callback to addDocument to indexWriter.
 java.util.List<org.apache.lucene.document.Document> getDocumentQueue()
           
 long getIndexInterval()
           
 FullIndexerStatus getStatus()
           
 boolean isInterupted()
          Check if the indexing process is interrupted.
 void run()
           
 void setIndexInterval(long indexInterval)
           
 void startIndexing()
          Start full indexer thread.
 void stopIndexing()
          Stop full indexer thread asynchron.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OlatFullIndexer

public OlatFullIndexer(java.lang.String tempIndexPath,
                       Index index,
                       long restartInterval,
                       long indexInterval)
Parameters:
tempIndexPath - Absolute file path to temporary index directory.
index - Reference to index object.
restartInterval - Restart interval in milliseconds.
indexInterval - Sleep time in milliseconds between adding documents.
Method Detail

startIndexing

public void startIndexing()
Start full indexer thread.


stopIndexing

public void stopIndexing()
Stop full indexer thread asynchron.


run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

addDocument

public void addDocument(org.apache.lucene.document.Document document)
                 throws java.io.IOException,
                        java.lang.InterruptedException
Callback to addDocument to indexWriter.

Parameters:
document -
Throws:
java.io.IOException
java.lang.InterruptedException

getStatus

public FullIndexerStatus getStatus()
Returns:
Return current full-indexer status.

getIndexInterval

public long getIndexInterval()

setIndexInterval

public void setIndexInterval(long indexInterval)
Parameters:
indexInterval - The indexInterval to set.

getDocumentQueue

public java.util.List<org.apache.lucene.document.Document> getDocumentQueue()
Returns:
Return document-queue which is used in multi-threaded mode.

isInterupted

public boolean isInterupted()
Check if the indexing process is interrupted.

Returns:
TRUE: indexing process is interrupted.