jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1462024 - in /jackrabbit/oak/trunk/oak-solr-core/src/main: java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProvider.java resources/solr/oak/conf/solrconfig.xml
Date Thu, 28 Mar 2013 10:38:49 GMT
Author: tommaso
Date: Thu Mar 28 10:38:49 2013
New Revision: 1462024

URL: http://svn.apache.org/r1462024
Log:
OAK-700 - fixed classloading issues for CoreContainer initialization in DefaultOakSolrProvider

Modified:
    jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProvider.java
    jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/solrconfig.xml

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProvider.java?rev=1462024&r1=1462023&r2=1462024&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/server/DefaultOakSolrProvider.java
Thu Mar 28 10:38:49 2013
@@ -59,8 +59,17 @@ public class DefaultOakSolrProvider impl
 
         checkSolrConfiguration(solrHomePath, solrConfigPath, coreName);
 
+        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+        Thread.currentThread().setContextClassLoader(CoreContainer.class.getClassLoader());
+
         CoreContainer coreContainer = new CoreContainer(solrHomePath);
-        coreContainer.load(solrHomePath, new File(solrConfigPath));
+        try {
+            coreContainer.load(solrHomePath, new File(solrConfigPath));
+        } finally {
+            Thread.currentThread().setContextClassLoader(classLoader);
+        }
+
+
         return new EmbeddedSolrServer(coreContainer, coreName);
     }
 

Modified: jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/solrconfig.xml?rev=1462024&r1=1462023&r2=1462024&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/solrconfig.xml (original)
+++ jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/oak/conf/solrconfig.xml Thu
Mar 28 10:38:49 2013
@@ -27,7 +27,7 @@
   <dataDir>${solr.data.dir:}</dataDir>
 
   <directoryFactory name="DirectoryFactory"
-                    class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}"/>
+                    class="${solr.directoryFactory:solr.MMapDirectoryFactory}"/>
 
 
   <indexConfig>
@@ -78,7 +78,7 @@
 
     <useColdSearcher>true</useColdSearcher>
 
-    <maxWarmingSearchers>10</maxWarmingSearchers>
+    <maxWarmingSearchers>2</maxWarmingSearchers>
 
   </query>
 



Mime
View raw message