MCPcopy Create free account
hub / github.com/apache/solr / reload

Method reload

solr/core/src/java/org/apache/solr/core/SolrCore.java:769–797  ·  view source on GitHub ↗
(ConfigSet coreConfig)

Source from the content-addressed store, hash-verified

767 * inform</code>, this could potentially throw a ConcurrentModificationException
768 *
769 * @see SolrCoreAware
770 */
771 public QueryResponseWriter registerResponseWriter(
772 String name, QueryResponseWriter responseWriter) {
773 return responseWriters.put(name, responseWriter);
774 }
775
776 public SolrCore reload(ConfigSet coreConfig) throws IOException {
777 // only one reload at a time
778 synchronized (getUpdateHandler().getSolrCoreState().getReloadLock()) {
779 solrCoreState.increfSolrCoreState();
780
781 // if directory is changing, then don't pass on state
782 boolean cloneCoreState = getNewIndexDir().equals(getIndexDir());
783
784 boolean success = false;
785 SolrCore core = null;
786 try {
787 CoreDescriptor cd = new CoreDescriptor(name, getCoreDescriptor());
788 cd.loadExtraProperties(); // Reload the extra properties
789 core = cloneForReloadCore(cd, coreConfig, cloneCoreState);
790
791 // we open a new IndexWriter to pick up the latest config
792 core.getUpdateHandler().getSolrCoreState().newIndexWriter(core, false);
793
794 core.getSearcher(true, false, null, true);
795 success = true;
796 return core;
797 } finally {
798 // close the new core on any errors that have occurred.
799 if (!success && core != null && core.getOpenCount() > 0) {
800 IOUtils.closeQuietly(core);

Callers 1

reloadMethod · 0.95

Calls 14

getUpdateHandlerMethod · 0.95
getNewIndexDirMethod · 0.95
getIndexDirMethod · 0.95
getCoreDescriptorMethod · 0.95
loadExtraPropertiesMethod · 0.95
cloneForReloadCoreMethod · 0.95
getSearcherMethod · 0.95
getOpenCountMethod · 0.95
closeQuietlyMethod · 0.95
increfSolrCoreStateMethod · 0.80
getReloadLockMethod · 0.45
getSolrCoreStateMethod · 0.45

Tested by

no test coverage detected