Class SimpleBulkOperationBuffer

java.lang.Object
com.atlassian.confluence.plugins.opensearch.bulk.SimpleBulkOperationBuffer
All Implemented Interfaces:
BulkOperationBuffer

public class SimpleBulkOperationBuffer extends Object implements BulkOperationBuffer
Simple implementation of BulkOperationBuffer that sends a bulk API request to OpenSearch when flush() is manually triggerred.
Since:
9.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleBulkOperationBuffer(org.opensearch.client.opensearch.OpenSearchClient client, io.github.resilience4j.retry.RetryRegistry retryRegistry)
     
  • 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SimpleBulkOperationBuffer

      public SimpleBulkOperationBuffer(org.opensearch.client.opensearch.OpenSearchClient client, io.github.resilience4j.retry.RetryRegistry retryRegistry)
  • Method Details

    • add

      public void add(org.opensearch.client.opensearch.core.bulk.BulkOperation op)
      Description copied from interface: BulkOperationBuffer
      Add a bulk operation to the buffer. Adding an operation might trigger a flush depending on the implementation.
      Specified by:
      add in interface BulkOperationBuffer
      Parameters:
      op - The operation to add to the buffer
    • flush

      public void flush() throws IOException
      Description copied from interface: BulkOperationBuffer
      Send all pending bulk operations in the buffer to OpenSearch bulk API
      Specified by:
      flush in interface BulkOperationBuffer
      Throws:
      IOException