Class LuceneIndexManagerImpl
- java.lang.Object
-
- org.hibernate.search.backend.lucene.index.impl.LuceneIndexManagerImpl
-
- All Implemented Interfaces:
LuceneIndexManager,ReadIndexManagerContext,LuceneScopeIndexManagerContext,LuceneSearchIndexContext,IndexManager,IndexManagerImplementor
public class LuceneIndexManagerImpl extends Object implements IndexManagerImplementor, LuceneIndexManager, LuceneScopeIndexManagerContext
-
-
Method Summary
-
-
-
Method Detail
-
saveForRestart
public SavedState saveForRestart()
- Specified by:
saveForRestartin interfaceIndexManagerImplementor
-
preStart
public void preStart(IndexManagerStartContext context, SavedState savedState)
Description copied from interface:IndexManagerImplementorStarts a subset of resources that are necessary to operate the index manager at runtime, and are expected to be reused upon restarts. The resources may be retrieved them from the saved state, or created if they are not present in the saved state.Called by the engine once after bootstrap, after
BackendImplementor.start(BackendStartContext)was called on the corresponding backend.- Specified by:
preStartin interfaceIndexManagerImplementor- Parameters:
context- The start context.savedState- The saved state returned by the corresponding index manager in the Hibernate Search integration being restarted, orSavedState.empty()on the first start.
-
start
public void start(IndexManagerStartContext context)
Description copied from interface:IndexManagerImplementorStart any resource necessary to operate the index manager at runtime.Called by the engine once just after
IndexManagerImplementor.preStart(IndexManagerStartContext, SavedState).- Specified by:
startin interfaceIndexManagerImplementor- Parameters:
context- The start context.
-
preStop
public CompletableFuture<?> preStop()
Description copied from interface:IndexManagerImplementorPrepare forIndexManagerImplementor.stop().- Specified by:
preStopin interfaceIndexManagerImplementor- Returns:
- A future that completes when ongoing works complete.
-
stop
public void stop()
Description copied from interface:IndexManagerImplementorStop and release any resource necessary to operate the backend at runtime.Called by the engine once before shutdown.
- Specified by:
stopin interfaceIndexManagerImplementor
-
schemaManager
public IndexSchemaManager schemaManager()
- Specified by:
schemaManagerin interfaceIndexManagerImplementor
-
createIndexingPlan
public IndexIndexingPlan createIndexingPlan(BackendSessionContext sessionContext, DocumentCommitStrategy commitStrategy, DocumentRefreshStrategy refreshStrategy)
- Specified by:
createIndexingPlanin interfaceIndexManagerImplementor
-
createIndexer
public IndexIndexer createIndexer(BackendSessionContext sessionContext)
- Specified by:
createIndexerin interfaceIndexManagerImplementor
-
createWorkspace
public IndexWorkspace createWorkspace(BackendMappingContext mappingContext, Set<String> tenantIds)
- Specified by:
createWorkspacein interfaceIndexManagerImplementor
-
createScopeBuilder
public IndexScopeBuilder createScopeBuilder(BackendMappingContext mappingContext)
- Specified by:
createScopeBuilderin interfaceIndexManagerImplementor
-
addTo
public void addTo(IndexScopeBuilder builder)
- Specified by:
addToin interfaceIndexManagerImplementor
-
openIndexReaders
public void openIndexReaders(Set<String> routingKeys, DirectoryReaderCollector readerCollector) throws IOException
- Specified by:
openIndexReadersin interfaceReadIndexManagerContext- Throws:
IOException
-
model
public LuceneIndexModel model()
- Specified by:
modelin interfaceLuceneScopeIndexManagerContext
-
identifier
public SearchIndexIdentifierContext identifier()
- Specified by:
identifierin interfaceLuceneSearchIndexContext
-
toAPI
public IndexManager toAPI()
- Specified by:
toAPIin interfaceIndexManagerImplementor- Returns:
- The object that should be exposed as API to users.
-
backend
public LuceneBackend backend()
- Specified by:
backendin interfaceIndexManager- Specified by:
backendin interfaceLuceneIndexManager- Returns:
- The backend in which this index manager is defined.
-
descriptor
public IndexDescriptor descriptor()
- Specified by:
descriptorin interfaceIndexManager- Returns:
- A descriptor of this index, exposing in particular a list of field and their characteristics.
-
indexingAnalyzer
public org.apache.lucene.analysis.Analyzer indexingAnalyzer()
- Specified by:
indexingAnalyzerin interfaceLuceneIndexManager- Returns:
- The analyzer used when indexing. This analyzer behaves differently for each field, delegating to the analyzer configured in the mapping.
-
searchAnalyzer
public org.apache.lucene.analysis.Analyzer searchAnalyzer()
- Specified by:
searchAnalyzerin interfaceLuceneIndexManager- Returns:
- The analyzer used in search queries. This analyzer behaves differently for each field, delegating to the analyzer configured in the mapping.
-
computeSizeInBytes
public long computeSizeInBytes()
- Specified by:
computeSizeInBytesin interfaceLuceneIndexManager- Returns:
- The size of the index on its storage support, in bytes.
-
computeSizeInBytesAsync
public CompletableFuture<Long> computeSizeInBytesAsync()
- Specified by:
computeSizeInBytesAsyncin interfaceLuceneIndexManager- Returns:
- A future that will ultimately provide the size of the index on its storage support, in bytes.
-
computeSizeInBytesAsync
public CompletableFuture<Long> computeSizeInBytesAsync(OperationSubmitter operationSubmitter)
- Specified by:
computeSizeInBytesAsyncin interfaceLuceneIndexManager- Parameters:
operationSubmitter- How to handle request to submit operation when the queue is full.- Returns:
- A future that will ultimately provide the size of the index on its storage support, in bytes.
-
unwrap
public <T> T unwrap(Class<T> clazz)
Description copied from interface:IndexManagerUnwrap the index manager to some implementation-specific type.- Specified by:
unwrapin interfaceIndexManager- Type Parameters:
T- The expected type- Parameters:
clazz- TheClassrepresenting the expected type- Returns:
- The unwrapped index manager.
-
-