org.compass.core.lucene.engine.optimizer
Class AbstractOptimizer

java.lang.Object
  extended by org.compass.core.lucene.engine.optimizer.AbstractOptimizer
All Implemented Interfaces:
LuceneSearchEngineOptimizer
Direct Known Subclasses:
AbstractIndexInfoOptimizer

public abstract class AbstractOptimizer
extends Object
implements LuceneSearchEngineOptimizer

A base class that all custom optimizers should extend from. Derived classes should implement doOptimize(String) and doForceOptimize(String).

Author:
kimchy

Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
AbstractOptimizer()
           
 
Method Summary
protected abstract  void doForceOptimize(String subIndex)
           
protected abstract  void doOptimize(String subIndex)
           
protected  void doStart()
           
protected  void doStop()
           
 void forceOptimize()
           
 void forceOptimize(String subIndex)
           
protected  LuceneSearchEngineFactory getSearchEngineFactory()
           
 boolean isRunning()
           
 void optimize()
          Optimizes the search engine index if it requires optimization.
 void optimize(String subIndex)
          Optimizes the sub index if it requires optimization.
 void setSearchEngineFactory(LuceneSearchEngineFactory searchEngineFactory)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.compass.core.lucene.engine.optimizer.LuceneSearchEngineOptimizer
canBeScheduled, optimize, optimize
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

AbstractOptimizer

public AbstractOptimizer()
Method Detail

start

public void start()
           throws SearchEngineException
Throws:
SearchEngineException

doStart

protected void doStart()
                throws SearchEngineException
Throws:
SearchEngineException

stop

public void stop()
          throws SearchEngineException
Throws:
SearchEngineException

doStop

protected void doStop()
               throws SearchEngineException
Throws:
SearchEngineException

isRunning

public boolean isRunning()

optimize

public void optimize()
              throws SearchEngineException
Description copied from interface: LuceneSearchEngineOptimizer
Optimizes the search engine index if it requires optimization.

Specified by:
optimize in interface LuceneSearchEngineOptimizer
Throws:
SearchEngineException

forceOptimize

public void forceOptimize()
                   throws SearchEngineException
Throws:
SearchEngineException

optimize

public void optimize(String subIndex)
              throws SearchEngineException
Description copied from interface: LuceneSearchEngineOptimizer
Optimizes the sub index if it requires optimization.

Specified by:
optimize in interface LuceneSearchEngineOptimizer
Parameters:
subIndex - The sub index to optimize
Throws:
SearchEngineException

forceOptimize

public void forceOptimize(String subIndex)
                   throws SearchEngineException
Throws:
SearchEngineException

doOptimize

protected abstract void doOptimize(String subIndex)
                            throws SearchEngineException
Throws:
SearchEngineException

doForceOptimize

protected abstract void doForceOptimize(String subIndex)
                                 throws SearchEngineException
Throws:
SearchEngineException

getSearchEngineFactory

protected LuceneSearchEngineFactory getSearchEngineFactory()

setSearchEngineFactory

public void setSearchEngineFactory(LuceneSearchEngineFactory searchEngineFactory)


Copyright (c) 2004-2009 The Compass Project.