You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2010/10/25 20:35:32 UTC
svn commit: r1027229 - in /lucene/dev/trunk/solr: CHANGES.txt
src/java/org/apache/solr/core/SolrCore.java
Author: markrmiller
Date: Mon Oct 25 18:35:31 2010
New Revision: 1027229
URL: http://svn.apache.org/viewvc?rev=1027229&view=rev
Log:
SOLR-1962: SolrCore#initIndex should not use a mix of indexPath and newIndexPath
Modified:
lucene/dev/trunk/solr/CHANGES.txt
lucene/dev/trunk/solr/src/java/org/apache/solr/core/SolrCore.java
Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1027229&r1=1027228&r2=1027229&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Mon Oct 25 18:35:31 2010
@@ -531,6 +531,8 @@ Bug Fixes
* SOLR-2173: Suggester should always rebuild Lookup data if Lookup.load fails. (ab)
* SOLR-2190: change xpath from RSS 0.9 to 1.0 in slashdot sample. (koji)
+
+* SOLR-1962: SolrCore#initIndex should not use a mix of indexPath and newIndexPath (Mark Miller)
Other Changes
----------------------
Modified: lucene/dev/trunk/solr/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/java/org/apache/solr/core/SolrCore.java?rev=1027229&r1=1027228&r2=1027229&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/dev/trunk/solr/src/java/org/apache/solr/core/SolrCore.java Mon Oct 25 18:35:31 2010
@@ -367,12 +367,12 @@ public final class SolrCore implements S
void initIndex() {
try {
-
initDirectoryFactory();
- boolean indexExists = getDirectoryFactory().exists(getNewIndexDir());
+ String indexDir = getNewIndexDir();
+ boolean indexExists = getDirectoryFactory().exists(indexDir);
boolean firstTime;
synchronized (SolrCore.class) {
- firstTime = dirs.add(new File(getNewIndexDir()).getCanonicalPath());
+ firstTime = dirs.add(new File(indexDir).getCanonicalPath());
}
boolean removeLocks = solrConfig.unlockOnStartup;
@@ -381,10 +381,10 @@ public final class SolrCore implements S
if (indexExists && firstTime && removeLocks) {
// to remove locks, the directory must already exist... so we create it
// if it didn't exist already...
- Directory dir = SolrIndexWriter.getDirectory(getIndexDir(), getDirectoryFactory(), solrConfig.mainIndexConfig);
+ Directory dir = SolrIndexWriter.getDirectory(indexDir, getDirectoryFactory(), solrConfig.mainIndexConfig);
if (dir != null) {
if (IndexWriter.isLocked(dir)) {
- log.warn(logid+"WARNING: Solr index directory '" + getIndexDir() + "' is locked. Unlocking...");
+ log.warn(logid+"WARNING: Solr index directory '" + indexDir+ "' is locked. Unlocking...");
IndexWriter.unlock(dir);
}
dir.close();
@@ -393,10 +393,10 @@ public final class SolrCore implements S
// Create the index if it doesn't exist.
if(!indexExists) {
- log.warn(logid+"Solr index directory '" + new File(getNewIndexDir()) + "' doesn't exist."
+ log.warn(logid+"Solr index directory '" + new File(indexDir) + "' doesn't exist."
+ " Creating new index...");
- SolrIndexWriter writer = new SolrIndexWriter("SolrCore.initIndex", getIndexDir(), getDirectoryFactory(), true, schema, solrConfig.mainIndexConfig, solrDelPolicy);
+ SolrIndexWriter writer = new SolrIndexWriter("SolrCore.initIndex", indexDir, getDirectoryFactory(), true, schema, solrConfig.mainIndexConfig, solrDelPolicy);
writer.close();
}