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.ConfigCallbackNested 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 TypeMethodDescriptionvoidvoidvoidbooleancreateIndex(String index) booleandeleteDocument(String index, String documentId) booleandeleteIndex(String index) voidflush()org.opensearch.client.RestHighLevelClientorg.opensearch.action.bulk.BulkProcessorbooleanindexDocument(String index, String documentId, String documentSource) booleanindexExists(String index) org.opensearch.action.search.SearchResponseorg.opensearch.action.search.SearchResponsevoidsetClient(org.opensearch.client.RestHighLevelClient client) voidsetInternalBulkProcessor(org.opensearch.action.bulk.BulkProcessor internalBulkProcessor) longlongMethods inherited from class org.apache.pulsar.io.elasticsearch.client.RestClient
close, getHttpHostsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
indexExistsin classRestClient- Throws:
IOException
-
createIndex
- Specified by:
createIndexin classRestClient- Throws:
IOException
-
deleteIndex
- Specified by:
deleteIndexin classRestClient- Throws:
IOException
-
indexDocument
public boolean indexDocument(String index, String documentId, String documentSource) throws IOException - Specified by:
indexDocumentin classRestClient- Throws:
IOException
-
deleteDocument
- Specified by:
deleteDocumentin classRestClient- Throws:
IOException
-
totalHits
- Specified by:
totalHitsin classRestClient- Throws:
IOException
-
totalHits
- Specified by:
totalHitsin 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:
getBulkProcessorin classRestClient
-
appendIndexRequest
- Specified by:
appendIndexRequestin interfaceBulkProcessor- Throws:
IOException
-
appendDeleteRequest
- Specified by:
appendDeleteRequestin interfaceBulkProcessor- Throws:
IOException
-
flush
public void flush()- Specified by:
flushin interfaceBulkProcessor
-
closeClient
public void closeClient()- Specified by:
closeClientin 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()
-