Class RestClient
java.lang.Object
org.apache.pulsar.io.elasticsearch.client.RestClient
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
ElasticSearchJavaRestClient,OpenSearchHighLevelRestClient
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ElasticSearchConfigprotected final RestClient.ConfigCallback -
Constructor Summary
ConstructorsConstructorDescriptionRestClient(ElasticSearchConfig elasticSearchConfig, BulkProcessor.Listener bulkProcessorListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected abstract voidabstract booleancreateIndex(String index) abstract booleandeleteDocument(String index, String documentId) abstract booleandeleteIndex(String index) abstract BulkProcessorprotected org.apache.http.HttpHost[]abstract booleanindexDocument(String index, String documentId, String documentSource) abstract booleanindexExists(String index) abstract longabstract long
-
Field Details
-
config
-
configCallback
-
-
Constructor Details
-
RestClient
public RestClient(ElasticSearchConfig elasticSearchConfig, BulkProcessor.Listener bulkProcessorListener)
-
-
Method Details
-
indexExists
- Throws:
IOException
-
createIndex
- Throws:
IOException
-
deleteIndex
- Throws:
IOException
-
indexDocument
public abstract boolean indexDocument(String index, String documentId, String documentSource) throws IOException - Throws:
IOException
-
deleteDocument
- Throws:
IOException
-
totalHits
- Throws:
IOException
-
totalHits
- Throws:
IOException
-
getBulkProcessor
-
getHttpHosts
protected org.apache.http.HttpHost[] getHttpHosts() -
closeClient
protected abstract void closeClient() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-