Author: shalin
Date: Thu Dec 18 05:18:41 2008
New Revision: 727719
URL: http://svn.apache.org/viewvc?rev=727719&view=rev
Log:
SOLR-863 -- SolrCore.initIndex should close the directory it gets for clearing
the lock and use the DirectoryFactory
Modified:
lucene/solr/trunk/CHANGES.txt
lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
Modified: lucene/solr/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=727719&r1=727718&r2=727719&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Thu Dec 18 05:18:41 2008
@@ -182,6 +182,9 @@
otherwise it writes fieldType.toObject. This fixes the bug with
encoding/decoding UUIDField.
(koji, Noble Paul, shalin)
+18. SOLR-863: SolrCore.initIndex should close the directory it gets for
clearing the lock and
+ use the DirectoryFactory. (Mark Miller via shalin)
+
Other Changes
----------------------
Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java?rev=727719&r1=727718&r2=727719&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java Thu Dec 18
05:18:41 2008
@@ -360,10 +360,13 @@
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(),
solrConfig.mainIndexConfig);
- if (dir != null && IndexWriter.isLocked(dir)) {
- log.warn(logid+"WARNING: Solr index directory '" + getIndexDir() +
"' is locked. Unlocking...");
- IndexWriter.unlock(dir);
+ Directory dir = SolrIndexWriter.getDirectory(getIndexDir(),
getDirectoryFactory(), solrConfig.mainIndexConfig);
+ if (dir != null) {
+ if (IndexWriter.isLocked(dir)) {
+ log.warn(logid+"WARNING: Solr index directory '" + getIndexDir() +
"' is locked. Unlocking...");
+ IndexWriter.unlock(dir);
+ }
+ dir.close();
}
}