|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.search.backend.Workspace
public class Workspace
Lucene workspace for a DirectoryProvider.
getIndexWriter(boolean) or getIndexReader() the lock must be acquired,
and resources must be closed before releasing the lock.IndexReader, and after that on
the IndexWriter
| Constructor Summary | |
|---|---|
Workspace(SearchFactoryImplementor searchFactoryImplementor,
DirectoryProvider<?> provider)
|
|
| Method Summary | ||
|---|---|---|
void |
closeIndexReader()
Closes a previously opened IndexReader. |
|
void |
closeIndexWriter()
Closes a previously opened IndexWriter. |
|
void |
commitIndexWriter()
Commits changes to a previously opened index writer. |
|
org.apache.lucene.analysis.Analyzer |
getAnalyzer(String name)
|
|
|
getDocumentBuilder(Class<T> entity)
|
|
Set<Class<?>> |
getEntitiesInDirectory()
|
|
org.apache.lucene.index.IndexReader |
getIndexReader()
Gets an IndexReader to alter the index, opening one if needed. |
|
org.apache.lucene.index.IndexWriter |
getIndexWriter(boolean batchmode)
Gets the IndexWriter, opening one if needed. |
|
void |
incrementModificationCounter(int modCount)
Increment the counter of modification operations done on the index. |
|
void |
lock()
Acquires a lock on the DirectoryProvider backing this Workspace; this is required to use getIndexWriter(boolean), closeIndexWriter(), getIndexReader(), closeIndexReader(). |
|
void |
optimize()
Used by OptimizeLuceneWork after index optimization to flag that optimization has been forced. |
|
void |
optimizerPhase()
If optimization has not been forced give a change to configured OptimizerStrategy to optimize the index. |
|
void |
unlock()
Releases the lock obtained by calling lock() |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Workspace(SearchFactoryImplementor searchFactoryImplementor,
DirectoryProvider<?> provider)
| Method Detail |
|---|
public <T> DocumentBuilderIndexedEntity<T> getDocumentBuilder(Class<T> entity)
public org.apache.lucene.analysis.Analyzer getAnalyzer(String name)
public void optimizerPhase()
org.hibernate.annotations.common.AssertionFailure - if the lock is not owned or if an IndexReader is open.public void optimize()
OptimizeLuceneWork,
SearchFactory.optimize(),
SearchFactory.optimize(Class)public org.apache.lucene.index.IndexReader getIndexReader()
org.hibernate.annotations.common.AssertionFailure - if an IndexWriter is open or if the lock is not owned.lock()public void closeIndexReader()
SearchException - on IOException during Lucene close operation.
org.hibernate.annotations.common.AssertionFailure - if the lock is not owned or if there is no IndexReader to close.getIndexReader()public org.apache.lucene.index.IndexWriter getIndexWriter(boolean batchmode)
batchmode - when true the indexWriter settings for batch mode will be applied.
Ignored if IndexWriter is open already.
org.hibernate.annotations.common.AssertionFailure - if an IndexReader is open or the lock is not owned.
SearchException - on a IOException during index opening.public void commitIndexWriter()
SearchException - on IOException during Lucene close operation.
org.hibernate.annotations.common.AssertionFailure - if there is no IndexWriter to close, or if the lock is not owned.public void closeIndexWriter()
SearchException - on IOException during Lucene close operation.
org.hibernate.annotations.common.AssertionFailure - if there is no IndexWriter to close, or if the lock is not owned.public void incrementModificationCounter(int modCount)
modCount - the increment to add to the counter.public Set<Class<?>> getEntitiesInDirectory()
public void lock()
getIndexWriter(boolean),
closeIndexWriter(),
getIndexReader(),
closeIndexReader()public void unlock()
org.hibernate.annotations.common.AssertionFailure - when unlocking without having closed IndexWriter or IndexReader.lock()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||