public class DirectoryBasedIndexManager extends Object implements IndexManager
IndexManager is coupled to a
DirectoryProvider and a DirectoryBasedReaderProvider.| Constructor and Description |
|---|
DirectoryBasedIndexManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addContainedEntity(Class<?> entity) |
protected BackendQueueProcessor |
createBackend(String indexName,
Properties cfg,
WorkerBuildContext buildContext) |
protected DirectoryProvider |
createDirectoryProvider(String indexName,
Properties cfg,
WorkerBuildContext buildContext) |
protected DirectoryBasedReaderProvider |
createIndexReader(String indexName,
Properties cfg,
WorkerBuildContext buildContext) |
void |
destroy()
Called when a
SearchFactory is stopped. |
Analyzer |
getAnalyzer(String name) |
BackendQueueProcessor |
getBackendQueueProcessor() |
Set<Class<?>> |
getContainedTypes() |
Lock |
getDirectoryModificationLock() |
DirectoryProvider |
getDirectoryProvider() |
EntityIndexBinding |
getIndexBinding(Class<?> entityType) |
LuceneIndexingParameters |
getIndexingParameters() |
String |
getIndexName()
Useful for labeling and logging resources from this instance.
|
OptimizerStrategy |
getOptimizerStrategy() |
ReaderProvider |
getReaderProvider()
Provide access to
IndexReaders. |
LuceneWorkSerializer |
getSerializer() |
Similarity |
getSimilarity() |
void |
initialize(String indexName,
Properties properties,
Similarity similarity,
WorkerBuildContext buildContext)
Initialize this
IndexManager before its use. |
void |
optimize()
To optimize the underlying index.
|
void |
performOperations(List<LuceneWork> workList,
IndexingMonitor monitor)
Used to apply update operations to the index.
|
void |
performStreamOperation(LuceneWork singleOperation,
IndexingMonitor monitor,
boolean forceAsync)
Perform a single non-transactional operation, best to stream large amounts of operations.
|
void |
setSearchFactory(ExtendedSearchIntegrator boundSearchIntegrator)
Connects this
IndexManager to a new ExtendedSearchintegrator. |
String |
toString() |
public String getIndexName()
IndexManagergetIndexName in interface IndexManagerpublic ReaderProvider getReaderProvider()
IndexManagerIndexReaders.getReaderProvider in interface IndexManagerReaderProvider instance for the index managed by this instancepublic void destroy()
IndexManagerSearchFactory is stopped. This method typically releases resources.destroy in interface IndexManagerpublic void initialize(String indexName, Properties properties, Similarity similarity, WorkerBuildContext buildContext)
IndexManagerIndexManager before its use.initialize in interface IndexManagerindexName - the unique name of the index (manager). Can be used to retrieve a IndexManager instance
via the search factory and IndexManagerHolder.properties - the configuration propertiesbuildContext - context information needed to initialize this index managerpublic Set<Class<?>> getContainedTypes()
getContainedTypes in interface IndexManagerpublic Similarity getSimilarity()
getSimilarity in interface IndexManagerSimilarity applied to this index. Note, only a single Similarity can be applied to
a given index.public void performStreamOperation(LuceneWork singleOperation, IndexingMonitor monitor, boolean forceAsync)
IndexManagerperformStreamOperation in interface IndexManagersingleOperation - the operation to performmonitor - no be notified of indexing eventsforceAsync - if true, the invocation will not block to wait for it being applied.
When false this will depend on the backend configuration.public void performOperations(List<LuceneWork> workList, IndexingMonitor monitor)
IndexManagerperformOperations in interface IndexManagerworkList - the list of write operations to apply.monitor - no be notified of indexing eventspublic Analyzer getAnalyzer(String name)
getAnalyzer in interface IndexManagername - the name of the analyzer to retrieve.Analyzer with the given name (see also AnalyzerDef)public void setSearchFactory(ExtendedSearchIntegrator boundSearchIntegrator)
IndexManagerIndexManager to a new ExtendedSearchintegrator.setSearchFactory in interface IndexManagerboundSearchIntegrator - the existing search factory to which to associate this index manager withpublic void addContainedEntity(Class<?> entity)
addContainedEntity in interface IndexManagerentity - Adds the specified entity type to this index manager, making it responsible for manging this type.public void optimize()
IndexManageroptimize in interface IndexManagerpublic LuceneWorkSerializer getSerializer()
getSerializer in interface IndexManagerpublic BackendQueueProcessor getBackendQueueProcessor()
public EntityIndexBinding getIndexBinding(Class<?> entityType)
public Lock getDirectoryModificationLock()
public DirectoryProvider getDirectoryProvider()
public OptimizerStrategy getOptimizerStrategy()
public LuceneIndexingParameters getIndexingParameters()
protected BackendQueueProcessor createBackend(String indexName, Properties cfg, WorkerBuildContext buildContext)
protected DirectoryBasedReaderProvider createIndexReader(String indexName, Properties cfg, WorkerBuildContext buildContext)
protected DirectoryProvider createDirectoryProvider(String indexName, Properties cfg, WorkerBuildContext buildContext)
Copyright © 2006-2015 Red Hat, Inc. All Rights Reserved