Interface BatchBackend
- All Known Implementing Classes:
LuceneBatchBackend
public interface BatchBackend
Implementations of this interface are not drop-in replacements for the standard BackendQueueProcessorFactory,
but are meant to be used only during batch processing.
The order of LuceneWork(s) processed is not guaranteed as the queue is consumed by several
concurrent workers.
-
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 props, MassIndexerProgressMonitor monitor, WorkerBuildContext context) Used at startup, called once as first method.voidstopAndFlush(long timeout, TimeUnit unit) Waits until all work is done and terminates the executors.
-
Method Details
-
initialize
Used at startup, called once as first method.- Parameters:
props- all configuration propertiesmonitor- the indexing progress monitorcontext- the build context for the workers
-
enqueueAsyncWork
Enqueues one work to be processed asynchronously- Parameters:
work-- Throws:
InterruptedException- if the current thread is interrupted while waiting for the work queue to have enough space.
-
doWorkInSync
Does one work in sync- Parameters:
work-- Throws:
InterruptedException
-
stopAndFlush
Waits until all work is done and terminates the executors. IndexWriter is not closed yet: work in sync can still be processed.- Throws:
InterruptedException- if the current thread is interrupted while waiting for the enqueued tasks to be finished.
-
close
void close()Used to shutdown and release resources. No other method should be used after this one.
-