jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1569281 - in /jackrabbit/oak/trunk/oak-solr-remote: ./ src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/
Date Tue, 18 Feb 2014 11:29:50 GMT
Author: tommaso
Date: Tue Feb 18 11:29:50 2014
New Revision: 1569281

URL: http://svn.apache.org/r1569281
Log:
OAK-1430 - set org.apache.solr.cloud dependency to be optional and ignored if not available

Modified:
    jackrabbit/oak/trunk/oak-solr-remote/pom.xml
    jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
    jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java

Modified: jackrabbit/oak/trunk/oak-solr-remote/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-remote/pom.xml?rev=1569281&r1=1569280&r2=1569281&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-remote/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-solr-remote/pom.xml Tue Feb 18 11:29:50 2014
@@ -44,7 +44,11 @@
             <Export-Package>
               org.apache.jackrabbit.oak.plugins.index.solr.http
             </Export-Package>
-            <Embed-Dependency>solr-solrj</Embed-Dependency>
+              <Import-Package>
+                  !org.apache.solr.cloud.*,
+                  *
+              </Import-Package>
+              <DynamicImport-Package>*</DynamicImport-Package>
           </instructions>
         </configuration>
       </plugin>

Modified: jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java?rev=1569281&r1=1569280&r2=1569281&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrConfigurationProvider.java
Tue Feb 18 11:29:50 2014
@@ -34,7 +34,7 @@ import org.osgi.service.component.Compon
  * the default behavior that properties are indexed by name.
  * Possible extensions of this class may trigger type based property indexing / search.
  */
-@Component(metatype = true)
+@Component(metatype = true, immediate = true, label = "Remote Solr Configuration Provider")
 @Service(OakSolrConfigurationProvider.class)
 public class RemoteSolrConfigurationProvider implements OakSolrConfigurationProvider {
 

Modified: jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java?rev=1569281&r1=1569280&r2=1569281&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-solr-remote/src/main/java/org/apache/jackrabbit/oak/plugins/index/solr/http/RemoteSolrServerProvider.java
Tue Feb 18 11:29:50 2014
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.io.File;
 import java.io.IOException;
-
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Deactivate;
@@ -41,7 +40,7 @@ import org.slf4j.LoggerFactory;
 /**
  * {@link SolrServerProvider} for remote Solr installations.
  */
-@Component(metatype = true, immediate = true)
+@Component(metatype = true, immediate = true, label = "Remote Solr Server Provider")
 @Service(SolrServerProvider.class)
 public class RemoteSolrServerProvider implements SolrServerProvider {
 
@@ -162,7 +161,13 @@ public class RemoteSolrServerProvider im
         cloudSolrServer.setDefaultCollection("collection1"); // workaround for first request
when the needed collection may not exist
 
         // create specified collection if it doesn't exists
-        createCollectionIfNeeded(cloudSolrServer);
+        try {
+            createCollectionIfNeeded(cloudSolrServer);
+        } catch (Throwable t) {
+            if (log.isWarnEnabled()) {
+                log.warn("could not create the collection on {}, {}", solrZkHost, t);
+            }
+        }
 
         cloudSolrServer.setDefaultCollection(solrCollection);
 
@@ -175,8 +180,8 @@ public class RemoteSolrServerProvider im
             } catch (Exception e) {
                 // wait a bit
                 try {
-                    if (log.isWarnEnabled()) {
-                        log.warn("wait a bit", e);
+                    if (log.isDebugEnabled()) {
+                        log.debug("server is not alive yet, wait a bit", e);
                     }
                     Thread.sleep(3000);
                 } catch (InterruptedException e1) {



Mime
View raw message