epugh commented on PR #2417:
URL: https://github.com/apache/solr/pull/2417#issuecomment-2083782067

   I think we should split the pure refactor out from the class loader stuff….
   
   On Mon, Apr 29, 2024 at 6:15 PM David Smiley ***@***.***>
   wrote:
   
   > ***@***.**** commented on this pull request.
   > ------------------------------
   >
   > In solr/core/src/java/org/apache/solr/cli/SolrCLI.java
   > <https://github.com/apache/solr/pull/2417#discussion_r1583843217>:
   >
   > > +
   > +  public static CloudHttp2SolrClient getCloudHttp2SolrClient(
   > +      String zkHost, Http2SolrClient.Builder builder) {
   > +    return new 
CloudHttp2SolrClient.Builder(Collections.singletonList(zkHost), 
Optional.empty())
   > +        .withSolrClassLoader(getSolrResourceLoader())
   > +        .withInternalClientBuilder(builder)
   > +        .build();
   > +  }
   > +
   > +  private static SolrResourceLoader getSolrResourceLoader() {
   > +    String dir = System.getProperty("solr.solr.home");
   > +    if (StrUtils.isNullOrEmpty(dir)) {
   > +      dir = System.getProperty("solr.install.dir");
   > +    }
   > +    final SolrResourceLoader loader = new 
SolrResourceLoader(Paths.get(dir));
   > +    NodeConfig.initModules(loader, null);
   >
   > Come to think of it, maybe even for the CLI case we don't need a fancy
   > ClassLoader trick. Just call Thread.currentThread().setContextClassLoader()
   > super early in the ZkCLI and furthermore ensure SolrZkClient sets the
   > current classLoader in its constructor / field initializer.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/solr/pull/2417#discussion_r1583843217>, or
   > unsubscribe
   > 
<https://github.com/notifications/unsubscribe-auth/AAAFO66W2K5ZXLXLNLSSJLDY73A7NAVCNFSM6AAAAABGTQZJB2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAMRZG42DMNBVGE>
   > .
   > You are receiving this because you were assigned.Message ID:
   > ***@***.***>
   >
   


-- 
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: issues-unsubscr...@solr.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to