I was hoping that a feature was lurking about and not yet added to the patch. How about something like this? Should it throw an exception if the core isn't found in the map?

Thanks,

-jrr


--- MultiCore.java.orig 2007-11-07 23:09:32.000000000 -0500
+++ MultiCore.java      2007-11-07 23:14:08.000000000 -0500
@@ -125,6 +125,25 @@
     }
   }

+  /**
+   * Stop and unregister a core of the given name
+   *
+   * @param name
+   */
+  public void shutdown ( String name )
+  {
+    if ( name == null || name.length() == 0 ) {
+      throw new RuntimeException("Invalid core name.");
+    }
+    synchronized ( cores ) {
+      SolrCore core = cores.get(name);
+      if ( core != null ) {
+        cores.remove(name);
+        core.close();
+      }
+    }
+  }
+
   @Override
   protected void finalize() {
     shutdown();


Ryan McKinley wrote:
Nothing yet... but check:
https://issues.apache.org/jira/browse/SOLR-350

ryan


John Reuning wrote:
For the MultiCore experts, is there an acceptable or approved way to close and unregister a single SolrCore? I'm interested in stopping cores, manipulating the solr directory tree, and reregistering them.

Thanks,

-John R.



Reply via email to