com.xpn.xwiki.plugin.lucene
Class IndexUpdater

java.lang.Object
  extended by com.xpn.xwiki.util.AbstractXWikiRunnable
      extended by com.xpn.xwiki.plugin.lucene.IndexUpdater
All Implemented Interfaces:
java.lang.Runnable, org.xwiki.observation.EventListener

public class IndexUpdater
extends com.xpn.xwiki.util.AbstractXWikiRunnable
implements org.xwiki.observation.EventListener

Version:
$Id: IndexUpdater.java 29723 2010-06-24 16:45:59Z tmortagne $

Method Summary
 void add(com.xpn.xwiki.doc.XWikiDocument document, com.xpn.xwiki.doc.XWikiAttachment attachment, com.xpn.xwiki.XWikiContext context)
           
 void add(com.xpn.xwiki.doc.XWikiDocument document, com.xpn.xwiki.XWikiContext context)
           
 int addAttachmentsOfDocument(com.xpn.xwiki.doc.XWikiDocument document, com.xpn.xwiki.XWikiContext context)
           
 void cleanIndex()
           
 void doExit()
           
 org.apache.lucene.store.Directory getDirectory()
          Return a reference to the directory that this updater is currently working with.
 java.util.List<org.xwiki.observation.event.Event> getEvents()
          
 long getLuceneDocCount()
           
 int getMaxQueueSize()
           
 java.lang.String getName()
          
 long getQueueSize()
           
 void onEvent(org.xwiki.observation.event.Event event, java.lang.Object source, java.lang.Object data)
          
protected  org.apache.lucene.index.IndexWriter openWriter(boolean create)
           
protected  void runInternal()
          Main loop.
 void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
           
 
Methods inherited from class com.xpn.xwiki.util.AbstractXWikiRunnable
cleanupExecutionContext, initExecutionContext, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doExit

public void doExit()

getDirectory

public org.apache.lucene.store.Directory getDirectory()
Return a reference to the directory that this updater is currently working with.


runInternal

protected void runInternal()
Main loop. Polls the queue for documents to be indexed.

Specified by:
runInternal in class com.xpn.xwiki.util.AbstractXWikiRunnable
See Also:
Runnable.run()

openWriter

protected org.apache.lucene.index.IndexWriter openWriter(boolean create)
                                                  throws java.io.IOException
Throws:
java.io.IOException

setAnalyzer

public void setAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
Parameters:
analyzer - The analyzer to set.

cleanIndex

public void cleanIndex()

add

public void add(com.xpn.xwiki.doc.XWikiDocument document,
                com.xpn.xwiki.XWikiContext context)

add

public void add(com.xpn.xwiki.doc.XWikiDocument document,
                com.xpn.xwiki.doc.XWikiAttachment attachment,
                com.xpn.xwiki.XWikiContext context)

addAttachmentsOfDocument

public int addAttachmentsOfDocument(com.xpn.xwiki.doc.XWikiDocument document,
                                    com.xpn.xwiki.XWikiContext context)

getName

public java.lang.String getName()

Specified by:
getName in interface org.xwiki.observation.EventListener
See Also:
EventListener.getName()

getEvents

public java.util.List<org.xwiki.observation.event.Event> getEvents()

Specified by:
getEvents in interface org.xwiki.observation.EventListener
See Also:
EventListener.getEvents()

onEvent

public void onEvent(org.xwiki.observation.event.Event event,
                    java.lang.Object source,
                    java.lang.Object data)

Specified by:
onEvent in interface org.xwiki.observation.EventListener
See Also:
EventListener.onEvent(org.xwiki.observation.event.Event, java.lang.Object, java.lang.Object)

getQueueSize

public long getQueueSize()
Returns:
the number of documents in the queue.

getLuceneDocCount

public long getLuceneDocCount()
Returns:
the number of documents in Lucene index writer.

getMaxQueueSize

public int getMaxQueueSize()


Copyright © 2004-2010 XWiki. All Rights Reserved.