org.hibernate.search.backend.impl.batchlucene
Interface BatchBackend

All Known Implementing Classes:
LuceneBatchBackend

public interface BatchBackend

Implementors 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.

Author:
Sanne Grinovero

Method Summary
 void close()
          Used to shutdown and release resources.
 void doWorkInSync(LuceneWork work)
          Does one work in sync
 void enqueueAsyncWork(LuceneWork work)
          Enqueues one work to be processed asynchronously
 void initialize(java.util.Properties props, MassIndexerProgressMonitor monitor, SearchFactoryImplementor searchFactory)
          Used at startup, called once as first method.
 void stopAndFlush(long timeout, java.util.concurrent.TimeUnit unit)
          Waits until all work is done and terminates the executors.
 

Method Detail

initialize

void initialize(java.util.Properties props,
                MassIndexerProgressMonitor monitor,
                SearchFactoryImplementor searchFactory)
Used at startup, called once as first method.

Parameters:
props - all configuration properties
searchFactory - the client

enqueueAsyncWork

void enqueueAsyncWork(LuceneWork work)
                      throws java.lang.InterruptedException
Enqueues one work to be processed asynchronously

Parameters:
work -
Throws:
java.lang.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:
java.lang.InterruptedException

stopAndFlush

void stopAndFlush(long timeout,
                  java.util.concurrent.TimeUnit unit)
                  throws java.lang.InterruptedException
Waits until all work is done and terminates the executors. IndexWriter is not closed yet: work in sync can still be processed.

Throws:
java.lang.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.



Copyright © 2006-2010 Hibernate. All Rights Reserved.