Class ElasticSearchClient
java.lang.Object
org.apache.skywalking.oap.server.library.client.elasticsearch.ElasticSearchClient
- All Implemented Interfaces:
Client,HealthCheckable
ElasticSearchClient connects to the ES server by using ES client APIs.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionElasticSearchClient(String clusterNodes, String protocol, String trustStorePath, String trustStorePass, String user, String password, Function<String, String> indexNameConverter, int connectTimeout, int socketTimeout, int responseTimeout, int numHttpClientThread) ElasticSearchClient(String clusterNodes, String protocol, String trustStorePath, Function<String, String> indexNameConverter, int connectTimeout, int socketTimeout, int responseTimeout, int numHttpClientThread) -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()createBulkProcessor(int bulkActions, int flushInterval, int concurrentRequests, int batchOfBytes) booleancreateIndex(String indexName) booleancreateIndex(String indexName, Mappings mappings, Map<String, ?> settings) booleanbooleandeleteByIndexName(String indexName) If your indexName is retrieved from elasticsearch throughretrievalIndexByAliases(String)or some other method and it already contains namespace.booleandeleteScrollContextQuietly(String scrollId) booleandeleteTemplate(String indexName) booleanvoidvoidformatIndexName(String indexName) getTemplate(String name) Provide to get documents from multi indices by IDs.booleanisExistsIndex(String indexName) booleanisExistsTemplate(String indexName) prepareInsert(String indexName, String id, Optional<String> routingValue, Map<String, Object> source) voidregisterChecker(HealthChecker healthChecker) Register health checker.retrievalIndexByAliases(String alias) search(String indexName, Search search, SearchParams params) Search by ids with index alias, when can not locate the physical index.voidsetPassword(String password) voidsetTrustStorePass(String trustStorePass) voidvoidshutdown()booleanupdateIndexMapping(String indexName, Mappings mapping)
-
Field Details
-
TYPE
- See Also:
-
-
Constructor Details
-
ElasticSearchClient
-
ElasticSearchClient
-
-
Method Details
-
connect
public void connect() -
shutdown
public void shutdown() -
registerChecker
Description copied from interface:HealthCheckableRegister health checker.- Specified by:
registerCheckerin interfaceHealthCheckable- Parameters:
healthChecker- HealthChecker to be registered.
-
createIndex
-
createIndex
-
updateIndexMapping
-
getIndex
-
retrievalIndexByAliases
-
deleteByIndexName
If your indexName is retrieved from elasticsearch throughretrievalIndexByAliases(String)or some other method and it already contains namespace. Then you should delete the index by this method, this method will no longer concatenate namespace. https://github.com/apache/skywalking/pull/3017 -
isExistsIndex
-
getTemplate
-
isExistsTemplate
-
createOrUpdateTemplate
-
deleteTemplate
-
search
-
search
-
search
-
scroll
-
deleteScrollContextQuietly
-
get
-
existDoc
-
ids
Provide to get documents from multi indices by IDs.- Parameters:
indexIds- key: indexName, value: ids list- Returns:
- Documents
- Since:
- 9.2.0
-
searchIDs
Search by ids with index alias, when can not locate the physical index. Otherwise, recommend use methodids(java.util.Map<java.lang.String, java.util.List<java.lang.String>>)- Parameters:
indexName- Index alias name or physical nameids- ID list- Returns:
- SearchResponse
- Since:
- 9.2.0 this method was ids
-
forceInsert
-
forceUpdate
-
prepareInsert
-
prepareInsert
-
prepareUpdate
-
createBulkProcessor
public BulkProcessor createBulkProcessor(int bulkActions, int flushInterval, int concurrentRequests, int batchOfBytes) -
formatIndexName
-
setTrustStorePass
-
setUser
-
setPassword
-