Class ElasticSearchJavaRestClient
java.lang.Object
org.apache.pulsar.io.elasticsearch.client.RestClient
org.apache.pulsar.io.elasticsearch.client.elastic.ElasticSearchJavaRestClient
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.pulsar.io.elasticsearch.client.RestClient
RestClient.ConfigCallback -
Field Summary
Fields inherited from class org.apache.pulsar.io.elasticsearch.client.RestClient
config, configCallback -
Constructor Summary
ConstructorsConstructorDescriptionElasticSearchJavaRestClient(ElasticSearchConfig elasticSearchConfig, BulkProcessor.Listener bulkProcessorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancreateIndex(String index) booleandeleteDocument(String index, String documentId) booleandeleteIndex(String index) co.elastic.clients.elasticsearch.ElasticsearchClientco.elastic.clients.transport.ElasticsearchTransportbooleanindexDocument(String index, String documentId, String documentSource) booleanindexExists(String index) co.elastic.clients.elasticsearch.core.SearchResponse<Map>co.elastic.clients.elasticsearch.core.SearchResponse<Map>voidsetBulkProcessor(BulkProcessor bulkProcessor) voidsetTransport(co.elastic.clients.transport.ElasticsearchTransport transport) longlongMethods inherited from class org.apache.pulsar.io.elasticsearch.client.RestClient
close, getHttpHosts
-
Constructor Details
-
ElasticSearchJavaRestClient
public ElasticSearchJavaRestClient(ElasticSearchConfig elasticSearchConfig, BulkProcessor.Listener bulkProcessorListener)
-
-
Method Details
-
setBulkProcessor
-
setTransport
public void setTransport(co.elastic.clients.transport.ElasticsearchTransport transport) -
indexExists
- Specified by:
indexExistsin classRestClient- Throws:
IOException
-
createIndex
- Specified by:
createIndexin classRestClient- Throws:
IOException
-
deleteIndex
- Specified by:
deleteIndexin classRestClient- Throws:
IOException
-
deleteDocument
- Specified by:
deleteDocumentin classRestClient- Throws:
IOException
-
indexDocument
public boolean indexDocument(String index, String documentId, String documentSource) throws IOException - Specified by:
indexDocumentin classRestClient- Throws:
IOException
-
search
public co.elastic.clients.elasticsearch.core.SearchResponse<Map> search(String indexName) throws IOException - Throws:
IOException
-
search
public co.elastic.clients.elasticsearch.core.SearchResponse<Map> search(String indexName, String query) throws IOException - Throws:
IOException
-
totalHits
- Specified by:
totalHitsin classRestClient- Throws:
IOException
-
totalHits
- Specified by:
totalHitsin classRestClient- Throws:
IOException
-
getBulkProcessor
- Specified by:
getBulkProcessorin classRestClient
-
closeClient
public void closeClient()- Specified by:
closeClientin classRestClient
-
getClient
public co.elastic.clients.elasticsearch.ElasticsearchClient getClient() -
getTransport
public co.elastic.clients.transport.ElasticsearchTransport getTransport()
-