asereda-gs commented on PR #2698:
URL: https://github.com/apache/calcite/pull/2698#issuecomment-1092199837

   Hi @jnturton ,
   
   Thanks for this PR. I'm not sure that having cache inside 
`ElasticsearchSchemaFactory.java` is the best approach. 
   
   I understand that you want to properly manage resource lifecycle. Is there a 
reason you can't share existing `ElasticsearchSchema` ?
   
   Is there a way in your environment to manually instantiate 
`ElasticsearchSchema` with existing `RestClient` instance (see 
[ElasticsearchSchema 
ctor](https://github.com/apache/calcite/blob/master/elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSchema.java#L65)?
 This way you can control when `RestClient` is closed.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to