org.hibernate.search.elasticsearch.processor.impl

## Interface ElasticsearchWorkBulker

-     public interface ElasticsearchWorkBulker

  Aggregates bulkable works into bulks and adds all resulting works to a sequence builder.

  Implementations are mutable and unlikely to be thread-safe.

  Author:
    Yoann Rodiere

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(BulkableElasticsearchWork<?> work)`
    `void` | `flushBulk()` Ensure that the bulk work (if any) is created.
    `boolean` | `flushBulked()` Ensure that all bulked works that haven't been added to a sequence yet are added to the underlying sequence builder.
    `void` | `reset()` Reset internal state.

- - ### Method Detail

    - #### add

          void add(BulkableElasticsearchWork<?> work)

      Parameters:
        `work` - A work to add to the current bulk

    - #### flushBulked

          boolean flushBulked()

      Ensure that all bulked works that haven't been added to a sequence yet are added to the underlying sequence builder.

      After this method is called, the underlying sequence builder can safely be used to build a new sequence, but the execution of bulked works in this sequence will block until `flushBulk()` has been called.

      Returns:
        `true` if works have been added to the sequence builder as part of the current bulk, `false` if they have been added as non-bulked works (for instance if there was only one work) or if no work was added to the sequence builder.

    - #### flushBulk

          void flushBulk()

      Ensure that the bulk work (if any) is created.

      This method expects that all works have been flushed to the sequence builder using `flushBulked()` beforehand.

      After this method is called, any new work added through `add(BulkableElasticsearchWork)` will be added to a new bulk.

    - #### reset

          void reset()

      Reset internal state.

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