org.hibernate.search.backend.impl.lucene
public abstract class AbstractWorkspaceImpl extends Object implements Workspace
| Modifier and Type | Field and Description |
|---|---|
protected org.hibernate.search.backend.impl.lucene.IndexWriterHolder |
writerHolder |
| Constructor and Description |
|---|
AbstractWorkspaceImpl(DirectoryBasedIndexManager indexManager,
WorkerBuildContext context,
Properties cfg) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
afterTransactionApplied(boolean someFailureHappened,
boolean streaming)
Invoked after all changes of a transaction are applied.
|
boolean |
areSingleTermDeletesSafe()
Return true if it's safe to perform index delete operations using only the identifier term.
|
Analyzer |
getAnalyzer(String name) |
<T> DocumentBuilderIndexedEntity<?> |
getDocumentBuilder(Class<T> entity) |
Set<Class<?>> |
getEntitiesInIndexManager() |
IndexWriter |
getIndexWriter()
Gets the IndexWriter, opening one if needed.
|
IndexWriter |
getIndexWriter(ErrorContextBuilder errorContextBuilder) |
protected void |
incrementModificationCounter() |
void |
optimizerPhase()
If optimization has not been forced give a chance to configured OptimizerStrategy
to optimize the index.
|
void |
performOptimization(IndexWriter writer)
Used by OptimizeLuceneWork to start an optimization process of the index.
|
void |
shutDownNow() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitflush, notifyWorkAppliedprotected final org.hibernate.search.backend.impl.lucene.IndexWriterHolder writerHolder
public AbstractWorkspaceImpl(DirectoryBasedIndexManager indexManager, WorkerBuildContext context, Properties cfg)
public <T> DocumentBuilderIndexedEntity<?> getDocumentBuilder(Class<T> entity)
getDocumentBuilder in interface Workspacepublic Analyzer getAnalyzer(String name)
getAnalyzer in interface Workspacepublic void optimizerPhase()
WorkspaceoptimizerPhase in interface Workspacepublic void performOptimization(IndexWriter writer)
WorkspaceperformOptimization in interface Workspacewriter - the IndexWriter to use for optimizationOptimizeLuceneWork,
SearchFactory.optimize(),
SearchFactory.optimize(Class)protected void incrementModificationCounter()
public Set<Class<?>> getEntitiesInIndexManager()
getEntitiesInIndexManager in interface Workspacepublic abstract void afterTransactionApplied(boolean someFailureHappened,
boolean streaming)
WorkspaceWorkspace.getIndexWriter() in a finally block
as implementations might rely on counters to release the IndexWriter.afterTransactionApplied in interface WorkspacesomeFailureHappened - usually false, set to true if errors
where caught while using the IndexWriterstreaming - if no immediate visibility of the change is required (hint for performance)public void shutDownNow()
public IndexWriter getIndexWriter()
WorkspacegetIndexWriter in interface Workspacepublic IndexWriter getIndexWriter(ErrorContextBuilder errorContextBuilder)
public boolean areSingleTermDeletesSafe()
WorkspaceareSingleTermDeletesSafe in interface WorkspaceCopyright © 2006-2015 Red Hat, Inc. All Rights Reserved