Class OpensearchClient

java.lang.Object
io.camunda.zeebe.exporter.opensearch.OpensearchClient
All Implemented Interfaces:
AutoCloseable

public class OpensearchClient extends Object implements AutoCloseable
  • Field Details

  • Method Details

    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • index

      public boolean index(Record<?> record, RecordSequence recordSequence)
      Indexes a record to the batch of records that will be sent to Elasticsearch
      Parameters:
      record - the record that will be the source of the document
      recordSequence - the sequence number of the record
      Returns:
      true if the record was appended to the batch, false if the record is already indexed in the batch because only one copy of the record is allowed in the batch
    • flush

      public void flush()
      Flushes the bulk request to Opensearch, unless it's currently empty.
      Throws:
      OpensearchExporterException - if not all items of the bulk were flushed successfully
    • shouldFlush

      public boolean shouldFlush()
      Returns whether the exporter should call flush() or not.
      Returns:
      true if flush() should be called, false otherwise
    • putIndexTemplate

      public boolean putIndexTemplate(ValueType valueType)
      Creates an index template for the given value type, read from the resources.
      Returns:
      true if request was acknowledged
    • putIndexTemplate

      public boolean putIndexTemplate(ValueType valueType, String version)
    • putComponentTemplate

      public boolean putComponentTemplate()
      Creates or updates the component template on the target Opensearch. The template is read from TemplateReader.readComponentTemplate().
    • createIndexStateManagementPolicy

      public boolean createIndexStateManagementPolicy()
    • updateIndexStateManagementPolicy

      public boolean updateIndexStateManagementPolicy(Integer seqNo, Integer primaryTerm)
    • deleteIndexStateManagementPolicy

      public boolean deleteIndexStateManagementPolicy()
    • bulkAddISMPolicyToAllZeebeIndices

      public boolean bulkAddISMPolicyToAllZeebeIndices()
    • bulkRemoveISMPolicyToAllZeebeIndices

      public boolean bulkRemoveISMPolicyToAllZeebeIndices()