You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/05/05 23:09:31 UTC

[GitHub] [lucene-solr] madrob commented on a change in pull request #1486: SOLR-14423: Use SolrClientCache instance managed by CoreContainer

madrob commented on a change in pull request #1486:
URL: https://github.com/apache/lucene-solr/pull/1486#discussion_r420459575



##########
File path: solr/core/src/java/org/apache/solr/handler/sql/CalciteSolrDriver.java
##########
@@ -59,11 +81,346 @@ public Connection connect(String url, Properties info) throws SQLException {
     if(schemaName == null) {
       throw new SQLException("zk must be set");
     }
-    rootSchema.add(schemaName, new SolrSchema(info));
+    SolrSchema solrSchema = new SolrSchema(info);
+    rootSchema.add(schemaName, solrSchema);
 
     // Set the default schema
     calciteConnection.setSchema(schemaName);
 
-    return connection;
+    return new SolrCalciteConnectionWrapper(calciteConnection, solrSchema);
+  }
+
+  // the sole purpose of this class is to be able to invoke SolrSchema.close()
+  // when the connection is closed.
+  private static final class SolrCalciteConnectionWrapper implements CalciteConnection {

Review comment:
       Can we have a new top level class that is a no-frills Wrapper, and then extend that here overriding just close? I think it is easier for people to see what is different.




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org