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
ConstructorDescriptionElasticSearchJavaRestClient
(ElasticSearchConfig elasticSearchConfig, BulkProcessor.Listener bulkProcessorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
createIndex
(String index) boolean
deleteDocument
(String index, String documentId) boolean
deleteIndex
(String index) co.elastic.clients.elasticsearch.ElasticsearchClient
co.elastic.clients.transport.ElasticsearchTransport
boolean
indexDocument
(String index, String documentId, String documentSource) boolean
indexExists
(String index) co.elastic.clients.elasticsearch.core.SearchResponse<Map>
co.elastic.clients.elasticsearch.core.SearchResponse<Map>
void
setBulkProcessor
(BulkProcessor bulkProcessor) void
setTransport
(co.elastic.clients.transport.ElasticsearchTransport transport) long
long
Methods 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:
indexExists
in classRestClient
- Throws:
IOException
-
createIndex
- Specified by:
createIndex
in classRestClient
- Throws:
IOException
-
deleteIndex
- Specified by:
deleteIndex
in classRestClient
- Throws:
IOException
-
deleteDocument
- Specified by:
deleteDocument
in classRestClient
- Throws:
IOException
-
indexDocument
public boolean indexDocument(String index, String documentId, String documentSource) throws IOException - Specified by:
indexDocument
in 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:
totalHits
in classRestClient
- Throws:
IOException
-
totalHits
- Specified by:
totalHits
in classRestClient
- Throws:
IOException
-
getBulkProcessor
- Specified by:
getBulkProcessor
in classRestClient
-
closeClient
public void closeClient()- Specified by:
closeClient
in classRestClient
-
getClient
public co.elastic.clients.elasticsearch.ElasticsearchClient getClient() -
getTransport
public co.elastic.clients.transport.ElasticsearchTransport getTransport()
-