|
||||||||||
| 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.
Before usinggetIndexWriter(boolean, org.hibernate.search.exception.impl.ErrorContextBuilder) the lock must be acquired,
and resources must be closed before releasing the lock.
| Constructor Summary | |
|---|---|
Workspace(WorkerBuildContext context,
DirectoryProvider<?> provider,
ErrorHandler errorHandler)
|
|
| Method Summary | ||
|---|---|---|
void |
closeIndexWriter()
Closes a previously opened IndexWriter. |
|
void |
commitIndexWriter()
|
|
void |
commitIndexWriter(ErrorContextBuilder errorContextBuilder)
Commits changes to a previously opened IndexWriter. |
|
void |
forceLockRelease()
Forces release of Directory lock. |
|
Analyzer |
getAnalyzer(String name)
|
|
|
getDocumentBuilder(Class<T> entity)
|
|
Set<Class<?>> |
getEntitiesInDirectory()
|
|
IndexWriter |
getIndexWriter(boolean batchmode)
|
|
IndexWriter |
getIndexWriter(boolean batchmode,
ErrorContextBuilder errorContextBuilder)
Gets the IndexWriter, opening one if needed. |
|
void |
incrementModificationCounter(int modCount)
Increment the counter of modification operations done on the index. |
|
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 chance to configured OptimizerStrategy to optimize the index. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Workspace(WorkerBuildContext context,
DirectoryProvider<?> provider,
ErrorHandler errorHandler)
| Method Detail |
|---|
public <T> DocumentBuilderIndexedEntity<T> getDocumentBuilder(Class<T> entity)
public Analyzer getAnalyzer(String name)
public void optimizerPhase()
public void optimize()
OptimizeLuceneWork,
SearchFactory.optimize(),
SearchFactory.optimize(Class)
public IndexWriter getIndexWriter(boolean batchmode,
ErrorContextBuilder errorContextBuilder)
batchmode - when true the indexWriter settings for batch mode will be applied.
Ignored if IndexWriter is open already.errorContextBuilder - might contain some context useful to provide when handling IOExceptions
public IndexWriter getIndexWriter(boolean batchmode)
getIndexWriter(boolean, ErrorContextBuilder)public void commitIndexWriter(ErrorContextBuilder errorContextBuilder)
errorContextBuilder - use it to handle exceptions, as it might contain a reference to the work performed before the commitpublic void commitIndexWriter()
commitIndexWriter(ErrorContextBuilder)public void closeIndexWriter()
public void incrementModificationCounter(int modCount)
modCount - the increment to add to the counter.public Set<Class<?>> getEntitiesInDirectory()
public void forceLockRelease()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||