org.hibernate.search.backend.spi

## Interface BatchBackend

- All Known Implementing Classes:
    DefaultBatchBackend

      public interface BatchBackend

  Implementations of this interface are not drop-in replacements for the standard BackendQueueProcessor, 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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `awaitAsyncProcessingCompletion()` Blocks until all the previously submitted work via `enqueueAsyncWork(LuceneWork)` are applied to the index.
    `void` | `doWorkInSync(LuceneWork work)` Does one work in sync
    `void` | `enqueueAsyncWork(LuceneWork work)` Enqueues one work to be processed asynchronously
    `void` | `flush(IndexedTypeSet indexedRootTypes)` Since most work is done async in the backend, we need to flush at the end to make sure we don't return control before all work was processed, and that IndexWriters are committed or closed.
    `void` | `optimize(IndexedTypeSet targetedClasses)` Triggers optimization of all indexes containing at least one instance of the listed targetedClasses.

- - ### Method Detail

    - #### enqueueAsyncWork

          void enqueueAsyncWork(LuceneWork work)
                         throws InterruptedException

      Enqueues one work to be processed asynchronously
      Parameters:
        `work` - a `LuceneWork` object.
      Throws:
        `InterruptedException` - if the current thread is interrupted while waiting for the work queue to have enough space.

    - #### awaitAsyncProcessingCompletion

          void awaitAsyncProcessingCompletion()

      Blocks until all the previously submitted work via `enqueueAsyncWork(LuceneWork)` are applied to the index.

    - #### doWorkInSync

          void doWorkInSync(LuceneWork work)

      Does one work in sync
      Parameters:
        `work` - the lucene work to execute

    - #### flush

          void flush(IndexedTypeSet indexedRootTypes)

      Since most work is done async in the backend, we need to flush at the end to make sure we don't return control before all work was processed, and that IndexWriters are committed or closed.
      Parameters:
        `indexedRootTypes` - a `Set` object.

    - #### optimize

          void optimize(IndexedTypeSet targetedClasses)

      Triggers optimization of all indexes containing at least one instance of the listed targetedClasses.
      Parameters:
        `targetedClasses` - Used to specify which indexes need optimization.

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved