You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2025/04/13 08:05:07 UTC
Re: [PR] [Bugfix][Elasticsearch] jobmanager memory leak (#9160) [seatunnel]
Copilot commented on code in PR #9161:
URL: https://github.com/apache/seatunnel/pull/9161#discussion_r2041071025
##########
seatunnel-connectors-v2/connector-elasticsearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/elasticsearch/source/ElasticsearchSourceSplitEnumerator.java:
##########
@@ -201,4 +204,30 @@ public ElasticsearchSourceState snapshotState(long checkpointId) throws Exceptio
@Override
public void notifyCheckpointComplete(long checkpointId) throws Exception {}
+
+ public List<IndexDocsCount> getIndexDocsCount(String index) {
+ List<String> hosts = connConfig.get(ElasticsearchBaseOptions.HOSTS);
+ String endpoint =
+ String.format(
+ "%s/_cat/indices/%s?h=index,docsCount&format=json", hosts.get(0), index);
+ HttpClientUtil httpClientUtil = new HttpClientUtil();
Review Comment:
[nitpick] Repeatedly instantiating HttpClientUtil and creating a new CloseableHttpClient for each request might introduce performance overhead; consider reusing a client instance if multiple requests are expected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org