Class OpenSearchHighLevelRestClient
java.lang.Object
org.apache.pulsar.io.elasticsearch.client.RestClient
org.apache.pulsar.io.elasticsearch.client.opensearch.OpenSearchHighLevelRestClient
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BulkProcessor
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pulsar.io.elasticsearch.client.RestClient
RestClient.ConfigCallback
Nested classes/interfaces inherited from interface org.apache.pulsar.io.elasticsearch.client.BulkProcessor
BulkProcessor.BulkDeleteRequest, BulkProcessor.BulkIndexRequest, BulkProcessor.BulkOperationRequest, BulkProcessor.BulkOperationResult, BulkProcessor.Listener
-
Field Summary
Fields inherited from class org.apache.pulsar.io.elasticsearch.client.RestClient
config, configCallback
-
Constructor Summary
ConstructorsConstructorDescriptionOpenSearchHighLevelRestClient
(ElasticSearchConfig elasticSearchConfig, BulkProcessor.Listener bulkProcessorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
boolean
createIndex
(String index) boolean
deleteDocument
(String index, String documentId) boolean
deleteIndex
(String index) void
flush()
org.opensearch.client.RestHighLevelClient
org.opensearch.action.bulk.BulkProcessor
boolean
indexDocument
(String index, String documentId, String documentSource) boolean
indexExists
(String index) org.opensearch.action.search.SearchResponse
org.opensearch.action.search.SearchResponse
void
setClient
(org.opensearch.client.RestHighLevelClient client) void
setInternalBulkProcessor
(org.opensearch.action.bulk.BulkProcessor internalBulkProcessor) long
long
Methods inherited from class org.apache.pulsar.io.elasticsearch.client.RestClient
close, getHttpHosts
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.pulsar.io.elasticsearch.client.BulkProcessor
close
-
Constructor Details
-
OpenSearchHighLevelRestClient
public OpenSearchHighLevelRestClient(ElasticSearchConfig elasticSearchConfig, BulkProcessor.Listener bulkProcessorListener)
-
-
Method Details
-
indexExists
- Specified by:
indexExists
in classRestClient
- Throws:
IOException
-
createIndex
- Specified by:
createIndex
in classRestClient
- Throws:
IOException
-
deleteIndex
- Specified by:
deleteIndex
in classRestClient
- Throws:
IOException
-
indexDocument
public boolean indexDocument(String index, String documentId, String documentSource) throws IOException - Specified by:
indexDocument
in classRestClient
- Throws:
IOException
-
deleteDocument
- Specified by:
deleteDocument
in classRestClient
- Throws:
IOException
-
totalHits
- Specified by:
totalHits
in classRestClient
- Throws:
IOException
-
totalHits
- Specified by:
totalHits
in classRestClient
- Throws:
IOException
-
search
- Throws:
IOException
-
search
public org.opensearch.action.search.SearchResponse search(String indexName, String query) throws IOException - Throws:
IOException
-
getBulkProcessor
- Specified by:
getBulkProcessor
in classRestClient
-
appendIndexRequest
- Specified by:
appendIndexRequest
in interfaceBulkProcessor
- Throws:
IOException
-
appendDeleteRequest
- Specified by:
appendDeleteRequest
in interfaceBulkProcessor
- Throws:
IOException
-
flush
public void flush()- Specified by:
flush
in interfaceBulkProcessor
-
closeClient
public void closeClient()- Specified by:
closeClient
in classRestClient
-
setClient
public void setClient(org.opensearch.client.RestHighLevelClient client) -
setInternalBulkProcessor
public void setInternalBulkProcessor(org.opensearch.action.bulk.BulkProcessor internalBulkProcessor) -
getClient
public org.opensearch.client.RestHighLevelClient getClient() -
getInternalBulkProcessor
public org.opensearch.action.bulk.BulkProcessor getInternalBulkProcessor()
-