You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2022/02/01 11:20:10 UTC

[GitHub] [calcite] zabetak edited a comment on pull request #2698: [CALCITE-4992] Close the ElasticSearch RestClient in ElasticsearchTransport

zabetak edited a comment on pull request #2698:
URL: https://github.com/apache/calcite/pull/2698#issuecomment-1026735660


   > a colleague of mine has raised a concern that recreating the RestClient for every request, as I've done in this iteration, might negatively affect effeciency. It would be nice to get your thoughts on this.
   
   @jnturton This might be true but talking about efficiency when there are resource leaks is a secondary concern.
   
   I guess you can tackle both efficiency and life-cycle management by introducing a wrapper interface around the `RestClient#performRequest` (e.g., `RequestExecutor`). The new interface should be responsible for managing the clients; one implementation could choose to create and destroy a client after every request just the way you do here where another could use the same client for multiple requests and release resources when certain time passes or some other event occurs.


-- 
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@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org