Class SolrServerService
java.lang.Object
fr.paris.lutece.plugins.search.solr.business.SolrServerService
This service provides an instance of SolrServer.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SolrServerServiceReturn the instance.org.apache.solr.client.solrj.SolrClientReturns the SolrServer.static voidshutdown()Close the SolrClient and release the instance.
-
Method Details
-
getInstance
Return the instance.- Returns:
- the instance.
-
getSolrServer
public org.apache.solr.client.solrj.SolrClient getSolrServer()Returns the SolrServer.- Returns:
- the SolrServer
-
shutdown
public static void shutdown()Close the SolrClient and release the instance. Http2SolrClient owns a Jetty HttpClient with its own thread pool ( threads named h2sc-N-thread-M ). Those threads are not tied to the web application : if the client is not closed when the context is destroyed, they outlive the undeployment, keep a reference to the stopped classloader and leak it. Repeated hot redeployments then end in OutOfMemoryError: Metaspace, with Tomcat logging "checkStateForResourceLoading" errors in the meantime. Called by SolrShutdownService, which the core runs from AppInitListener.contextDestroyed.
-