Interface BulkOperationBuffer

All Known Implementing Classes:
MaxDocsBulkOperationBuffer, MaxRamBulkOperationBuffer, SimpleBulkOperationBuffer

public interface BulkOperationBuffer
Collects OpenSearch operations in memory before being sent to OpenSearch bulk API.
Since:
9.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(org.opensearch.client.opensearch.core.bulk.BulkOperation op)
    Add a bulk operation to the buffer.
    void
    Send all pending bulk operations in the buffer to OpenSearch bulk API
  • Method Details

    • add

      void add(org.opensearch.client.opensearch.core.bulk.BulkOperation op) throws IOException
      Add a bulk operation to the buffer. Adding an operation might trigger a flush depending on the implementation.
      Parameters:
      op - The operation to add to the buffer
      Throws:
      SearchIndexAccessException - in case of IO error such as connection reset or for partial failure (when some documents were not written). Some implementations will trigger flush when adding an operation. This explains why an exception can be thrown.
      IOException
    • flush

      void flush() throws IOException
      Send all pending bulk operations in the buffer to OpenSearch bulk API
      Throws:
      SearchIndexAccessException - in case of IO error such as connection reset or for partial failure (when some documents were not written).
      IOException