类 ElasticSearchClient

java.lang.Object
org.apache.pulsar.io.elasticsearch.ElasticSearchClient
所有已实现的接口:
AutoCloseable

public class ElasticSearchClient extends Object implements AutoCloseable
  • 方法详细资料

    • bulkIndex

      public void bulkIndex(org.apache.pulsar.functions.api.Record<org.apache.pulsar.client.api.schema.GenericObject> record, org.apache.commons.lang3.tuple.Pair<String,String> idAndDoc) throws Exception
      抛出:
      Exception
    • indexDocument

      public boolean indexDocument(org.apache.pulsar.functions.api.Record<org.apache.pulsar.client.api.schema.GenericObject> record, org.apache.commons.lang3.tuple.Pair<String,String> idAndDoc) throws Exception
      Index an elasticsearch document and ack the record.
      参数:
      record -
      idAndDoc -
      返回:
      抛出:
      Exception
    • bulkDelete

      public void bulkDelete(org.apache.pulsar.functions.api.Record<org.apache.pulsar.client.api.schema.GenericObject> record, String id) throws Exception
      抛出:
      Exception
    • deleteDocument

      public boolean deleteDocument(org.apache.pulsar.functions.api.Record<org.apache.pulsar.client.api.schema.GenericObject> record, String id) throws Exception
      Delete an elasticsearch document and ack the record.
      参数:
      record -
      id -
      返回:
      抛出:
      IOException
      Exception
    • flush

      public void flush()
      Flushes the bulk processor.
    • close

      public void close()
      指定者:
      close 在接口中 AutoCloseable
    • topicToIndexName

      public String topicToIndexName(String topicName)
    • createIndexIfNeeded

      public boolean createIndexIfNeeded(String indexName) throws IOException
      抛出:
      IOException
    • indexExists

      public boolean indexExists(String indexName) throws IOException
      抛出:
      IOException
    • totalHits

      protected long totalHits(String indexName) throws IOException
      抛出:
      IOException
    • search

      protected org.opensearch.action.search.SearchResponse search(String indexName) throws IOException
      抛出:
      IOException
    • delete

      protected org.opensearch.action.support.master.AcknowledgedResponse delete(String indexName) throws IOException
      抛出:
      IOException