jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1492108 - in /jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene: LuceneIndexConstants.java LuceneIndexEditor.java
Date Wed, 12 Jun 2013 08:24:17 GMT
Author: jukka
Date: Wed Jun 12 08:24:17 2013
New Revision: 1492108

URL: http://svn.apache.org/r1492108
Log:
OAK-860: Streamline the IndexEditor

The Lucene indexer setup should already guarantee that there's only one
active writer at any given time, so there should be no need for locking

Modified:
    jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java
    jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java?rev=1492108&r1=1492107&r2=1492108&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexConstants.java
Wed Jun 12 08:24:17 2013
@@ -47,21 +47,4 @@ public interface LuceneIndexConstants {
 
     String INDEX_PATH = "index";
 
-    /**
-     * Lucene writer timeout write lock setting
-     */
-    int TO_WRITE_LOCK_MS = 50;
-
-    /**
-     * Controls how many retries should happen when there is a writer lock
-     * timeout
-     */
-    int TO_MAX_RETRIES = 3;
-
-    /**
-     * Controls how much sleep (ms) should happen when there is a writer lock
-     * timeout
-     */
-    int TO_SLEEP_MS = 30;
-
 }

Modified: jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java?rev=1492108&r1=1492107&r2=1492108&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexEditor.java
Wed Jun 12 08:24:17 2013
@@ -26,9 +26,9 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.INCLUDE_PROPERTY_TYPES;
 import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.INDEX_DATA_CHILD_NAME;
 import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.PERSISTENCE_PATH;
-import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.TO_WRITE_LOCK_MS;
 import static org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexConstants.VERSION;
 import static org.apache.jackrabbit.oak.plugins.index.lucene.TermFactory.newPathTerm;
+import static org.apache.lucene.store.NoLockFactory.getNoLockFactory;
 
 import java.io.File;
 import java.io.IOException;
@@ -88,7 +88,6 @@ public class LuceneIndexEditor implement
         try {
             IndexWriterConfig config = new IndexWriterConfig(VERSION, ANALYZER);
             config.setMergeScheduler(new SerialMergeScheduler());
-            config.setWriteLockTimeout(TO_WRITE_LOCK_MS);
             return config;
         } finally {
             thread.setContextClassLoader(loader);
@@ -105,7 +104,14 @@ public class LuceneIndexEditor implement
             try {
                 File file = new File(path);
                 file.mkdirs();
-                return FSDirectory.open(file); // TODO: close() is never called
+                // TODO: close() is never called
+                // TODO: no locking used
+                // --> using the FS backend for the index is in any case
+                //     troublesome in clustering scenarios and for backup
+                //     etc. so instead of fixing these issues we'd better
+                //     work on making the in-content index work without
+                //     problems (or look at the Solr indexer as alternative)
+                return FSDirectory.open(file, getNoLockFactory());
             } catch (IOException e) {
                 throw new CommitFailedException(
                         "Lucene", 1, "Failed to open the index in " + path, e);



Mime
View raw message