SMILA (incubation) API documentation

org.eclipse.smila.search.lucene.index.access
Class IndexWriterPool

java.lang.Object
  extended by org.eclipse.smila.search.lucene.index.access.IndexWriterPool

public final class IndexWriterPool
extends java.lang.Object

A Pool of IndexWriter objects.


Method Summary
static void closeAll()
          Closes all created IndexWriter objects.
static void closeIndexWriter(java.lang.String indexName)
          Closes the IndexWriter for the given index name.
static void flushIndexWriter(java.lang.String indexName)
          Flushes the IndexWriter for the given indexName.
static IndexWriter getIndexWriter(java.lang.String indexName, java.lang.String storage, Analyzer analyzer)
          Gets a IndexWriter object from the pool of IndexWriters or creates a new one if for the given index none exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIndexWriter

public static IndexWriter getIndexWriter(java.lang.String indexName,
                                         java.lang.String storage,
                                         Analyzer analyzer)
                                  throws IndexException
Gets a IndexWriter object from the pool of IndexWriters or creates a new one if for the given index none exists.

Parameters:
indexName - name of the index
storage - the path to the index
analyzer - Analyzer used for IndexWriter creation
Returns:
a IndexWriter
Throws:
IndexException - if any error occurs

flushIndexWriter

public static void flushIndexWriter(java.lang.String indexName)
                             throws IndexException
Flushes the IndexWriter for the given indexName. Quietly ignores any not existing index names.

Parameters:
indexName - the name of the index
Throws:
IndexException - if any error occurs

closeIndexWriter

public static void closeIndexWriter(java.lang.String indexName)
                             throws IndexException
Closes the IndexWriter for the given index name.

Parameters:
indexName - name of the index
Throws:
IndexException - if any error occurs

closeAll

public static void closeAll()
                     throws IndexException
Closes all created IndexWriter objects.

Throws:
IndexException - if any error occurs

SMILA (incubation) API documentation