Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-605 -- adding thread safety comment

Ryan McKinley3d1ce65a6e0c
diff --git a/src/java/org/apache/solr/core/SolrCore.java b/src/java/org/apache/solr/core/SolrCore.java
index 903366ecb1d..0f3eadb9da4 100644
--- a/src/java/org/apache/solr/core/SolrCore.java
+++ b/src/java/org/apache/solr/core/SolrCore.java
@@ -44,6 +44,7 @@ import org.apache.solr.update.processor.UpdateRequestProcessorFactory;
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 @@ public final class SolrCore {
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);
}
diff --git a/src/java/org/apache/solr/update/UpdateHandler.java b/src/java/org/apache/solr/update/UpdateHandler.java
index e84daf14924..9b4f8acd42d 100644
--- a/src/java/org/apache/solr/update/UpdateHandler.java
+++ b/src/java/org/apache/solr/update/UpdateHandler.java
@@ -179,11 +179,25 @@ public abstract class UpdateHandler implements SolrInfoMBean {
}
+ /**
+ * 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 );