You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by ry...@apache.org on 2008/07/07 22:19:37 UTC

svn commit: r674619 - in /lucene/solr/trunk/src/java/org/apache/solr: core/SolrCore.java update/UpdateHandler.java

Author: ryan
Date: Mon Jul  7 13:19:37 2008
New Revision: 674619

URL: http://svn.apache.org/viewvc?rev=674619&view=rev
Log:
SOLR-605 -- adding thread safety comment

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
    lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java?rev=674619&r1=674618&r2=674619&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java Mon Jul  7 13:19:37 2008
@@ -44,6 +44,7 @@
 import org.apache.solr.util.RefCounted;
 import org.apache.solr.util.plugin.AbstractPluginLoader;
 import org.apache.solr.util.plugin.NamedListPluginLoader;
+import org.apache.solr.util.plugin.SolrCoreAware;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
@@ -207,16 +208,37 @@
     newSearcherListeners = parseListener("//listener[@event=\"newSearcher\"]");
   }
   
+  /**
+   * NOTE: this function is not thread safe.  However, it is safe to call within the
+   * <code>inform( SolrCore core )</code> function for <code>SolrCoreAware</code> classes.
+   * Outside <code>inform</code>, this could potentially throw a ConcurrentModificationException
+   * 
+   * @see SolrCoreAware
+   */
   public void registerFirstSearcherListener( SolrEventListener listener )
   {
     firstSearcherListeners.add( listener );
   }
 
+  /**
+   * NOTE: this function is not thread safe.  However, it is safe to call within the
+   * <code>inform( SolrCore core )</code> function for <code>SolrCoreAware</code> classes.
+   * Outside <code>inform</code>, this could potentially throw a ConcurrentModificationException
+   * 
+   * @see SolrCoreAware
+   */
   public void registerNewSearcherListener( SolrEventListener listener )
   {
     newSearcherListeners.add( listener );
   }
 
+  /**
+   * NOTE: this function is not thread safe.  However, it is safe to call within the
+   * <code>inform( SolrCore core )</code> function for <code>SolrCoreAware</code> classes.
+   * Outside <code>inform</code>, this could potentially throw a ConcurrentModificationException
+   * 
+   * @see SolrCoreAware
+   */
   public void registerResponseWriter( String name, QueryResponseWriter responseWriter ){
     responseWriters.put(name, responseWriter);
   }

Modified: lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java?rev=674619&r1=674618&r2=674619&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java Mon Jul  7 13:19:37 2008
@@ -179,11 +179,25 @@
   }
 
 
+  /**
+   * NOTE: this function is not thread safe.  However, it is safe to call within the
+   * <code>inform( SolrCore core )</code> function for <code>SolrCoreAware</code> classes.
+   * Outside <code>inform</code>, this could potentially throw a ConcurrentModificationException
+   * 
+   * @see SolrCoreAware
+   */
   public void registerCommitCallback( SolrEventListener listener )
   {
     commitCallbacks.add( listener );
   }
 
+  /**
+   * NOTE: this function is not thread safe.  However, it is safe to call within the
+   * <code>inform( SolrCore core )</code> function for <code>SolrCoreAware</code> classes.
+   * Outside <code>inform</code>, this could potentially throw a ConcurrentModificationException
+   * 
+   * @see SolrCoreAware
+   */
   public void registerOptimizeCallback( SolrEventListener listener )
   {
     optimizeCallbacks.add( listener );