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 Details

    • initialize

      void initialize(Properties props, MassIndexerProgressMonitor monitor, WorkerBuildContext context)
      Used at startup, called once as first method.
      Parameters:
      props - all configuration properties
      monitor - the indexing progress monitor
      context - the build context for the workers
    • enqueueAsyncWork

      void enqueueAsyncWork(LuceneWork work) throws InterruptedException
      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

      void doWorkInSync(LuceneWork work)
      Does one work in sync
      Parameters:
      work -
      Throws:
      InterruptedException
    • stopAndFlush

      void stopAndFlush(long timeout, TimeUnit unit) throws InterruptedException
      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.