Class LuceneBatchBackend
java.lang.Object
org.hibernate.search.backend.impl.batchlucene.LuceneBatchBackend
- All Implemented Interfaces:
BatchBackend
This is not meant to be used as a regular
backend, only to apply batch changes to the index. Several threads
are used to make changes to each index, so order of Work processing is not guaranteed.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Used to shutdown and release resources.voiddoWorkInSync(LuceneWork work) Does one work in syncvoidenqueueAsyncWork(LuceneWork work) Enqueues one work to be processed asynchronouslyvoidinitialize(Properties cfg, MassIndexerProgressMonitor monitor, WorkerBuildContext context) Used at startup, called once as first method.voidstopAndFlush(long timeout, TimeUnit unit) Stops the background threads and flushes changes; Please note the timeout is applied to each index in sequence, so it might take as much time as timeout*directoryproviders
-
Field Details
-
CONCURRENT_WRITERS
- See Also:
-
-
Constructor Details
-
LuceneBatchBackend
public LuceneBatchBackend()
-
-
Method Details
-
initialize
public void initialize(Properties cfg, MassIndexerProgressMonitor monitor, WorkerBuildContext context) Description copied from interface:BatchBackendUsed at startup, called once as first method.- Specified by:
initializein interfaceBatchBackend- Parameters:
cfg- all configuration propertiesmonitor- the indexing progress monitorcontext- the build context for the workers
-
enqueueAsyncWork
Description copied from interface:BatchBackendEnqueues one work to be processed asynchronously- Specified by:
enqueueAsyncWorkin interfaceBatchBackend- Parameters:
work-- Throws:
InterruptedException- if the current thread is interrupted while waiting for the work queue to have enough space.
-
doWorkInSync
Description copied from interface:BatchBackendDoes one work in sync- Specified by:
doWorkInSyncin interfaceBatchBackend- Parameters:
work-
-
stopAndFlush
Stops the background threads and flushes changes; Please note the timeout is applied to each index in sequence, so it might take as much time as timeout*directoryproviders- Specified by:
stopAndFlushin interfaceBatchBackend- Throws:
InterruptedException- if the current thread is interrupted while waiting for the enqueued tasks to be finished.
-
close
public void close()Description copied from interface:BatchBackendUsed to shutdown and release resources. No other method should be used after this one.- Specified by:
closein interfaceBatchBackend
-