org.hibernate.search.store
Interface Workspace

All Known Implementing Classes:
AbstractWorkspaceImpl, ExclusiveIndexWorkspaceImpl, NRTWorkspaceImpl, SharedIndexWorkspaceImpl

public interface Workspace

Author:
Sanne Grinovero (C) 2011 Red Hat Inc.

Method Summary
 void afterTransactionApplied(boolean someFailureHappened, boolean streaming)
          Invoked after all changes of a transaction are applied
 org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
           
<T> DocumentBuilderIndexedEntity<?>
getDocumentBuilder(Class<T> entity)
           
 Set<Class<?>> getEntitiesInIndexManager()
           
 org.apache.lucene.index.IndexWriter getIndexWriter()
          Gets the IndexWriter, opening one if needed.
 void incrementModificationCounter(int modCount)
          Increment the counter of modification operations done on the index.
 void optimizerPhase()
          If optimization has not been forced give a chance to configured OptimizerStrategy to optimize the index.
 void performOptimization(org.apache.lucene.index.IndexWriter writer)
          Used by OptimizeLuceneWork to start an optimization process of the index.
 

Method Detail

getDocumentBuilder

<T> DocumentBuilderIndexedEntity<?> getDocumentBuilder(Class<T> entity)

getAnalyzer

org.apache.lucene.analysis.Analyzer getAnalyzer(String name)

optimizerPhase

void optimizerPhase()
If optimization has not been forced give a chance to configured OptimizerStrategy to optimize the index.


performOptimization

void performOptimization(org.apache.lucene.index.IndexWriter writer)
Used by OptimizeLuceneWork to start an optimization process of the index.

Parameters:
writer - the IndexWriter to use for optimization
See Also:
OptimizeLuceneWork, SearchFactory.optimize(), SearchFactory.optimize(Class)

getIndexWriter

org.apache.lucene.index.IndexWriter getIndexWriter()
Gets the IndexWriter, opening one if needed.

Returns:
a new IndexWriter or an already open one, or null if an error happened.

incrementModificationCounter

void incrementModificationCounter(int modCount)
Increment the counter of modification operations done on the index. Used (currently only) by the OptimizerStrategy.

Parameters:
modCount - the increment to add to the counter.

getEntitiesInIndexManager

Set<Class<?>> getEntitiesInIndexManager()
Returns:
The unmodifiable set of entity types being indexed in the underlying IndexManager backing this Workspace.

afterTransactionApplied

void afterTransactionApplied(boolean someFailureHappened,
                             boolean streaming)
Invoked after all changes of a transaction are applied

Parameters:
someFailureHappened - usually false, set to true if errors where caught while using the IndexWriter
streaming - if no immediate visibility of the change is required (hint for performance)


Copyright © 2006-2012 Hibernate. All Rights Reserved.