lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthieu Labour <matth...@strateer.com>
Subject CoreContainer / getCore and create ?
Date Fri, 22 Jan 2010 20:29:20 GMT
Hi

Would it make sense to modify/ add a method to CoreContainer that creates a
core if the core doesn't exist ?

something like

public SolrCore getCore(String name) {
    synchronized(cores) {
      SolrCore core = cores.get(name);
      if (core != null)
        core.open();  // increment the ref count while still synchronized
      else {
      core = create(name);
      cores.put(name,core);
    }
      return core;
    }
  }


My apology if this already documented...

matt

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message