jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r801226 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene: MultiIndex.java Recovery.java SearchIndex.java
Date Wed, 05 Aug 2009 13:31:59 GMT
Author: mreutegg
Date: Wed Aug  5 13:31:59 2009
New Revision: 801226

URL: http://svn.apache.org/viewvc?rev=801226&view=rev
Log:
JCR-2219: Improved background text extraction
- reverting 801135 change

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Recovery.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java?rev=801226&r1=801225&r2=801226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MultiIndex.java
Wed Aug  5 13:31:59 2009
@@ -436,7 +436,7 @@
 
             // flush whole index when volatile index has been commited.
             if (flush) {
-                internalFlush();
+                flush();
             }
         } finally {
             synchronized (updateMonitor) {
@@ -781,7 +781,7 @@
                 log.error("Exception while closing search index.", e);
             }
             try {
-                internalFlush();
+                flush();
             } catch (IOException e) {
                 log.error("Exception while closing search index.", e);
             }
@@ -881,33 +881,11 @@
 
     /**
      * Flushes this <code>MultiIndex</code>. Persists all pending changes and
-     * resets the redo log. When this method returned the {@link #multiReader}
-     * is released and and set to <code>null</code>.
-     *
-     * @throws IOException if the flush fails.
-     */
-    void flush() throws IOException {
-        synchronized (updateMonitor) {
-            updateInProgress = true;
-        }
-        try {
-            internalFlush();
-        } finally {
-            synchronized (updateMonitor) {
-                updateInProgress = false;
-                updateMonitor.notifyAll();
-                releaseMultiReader();
-            }
-        }
-    }
-
-    /**
-     * Flushes this <code>MultiIndex</code>. Persists all pending changes and
      * resets the redo log.
      *
      * @throws IOException if the flush fails.
      */
-    private void internalFlush() throws IOException {
+    void flush() throws IOException {
         synchronized (this) {
             // commit volatile index
             executeAndLog(new Start(Action.INTERNAL_TRANSACTION));
@@ -1176,7 +1154,18 @@
                 if (redoLog.hasEntries()) {
                     log.debug("Flushing index after being idle for "
                             + idleTime + " ms.");
-                    flush();
+                    synchronized (updateMonitor) {
+                        updateInProgress = true;
+                    }
+                    try {
+                        flush();
+                    } finally {
+                        synchronized (updateMonitor) {
+                            updateInProgress = false;
+                            updateMonitor.notifyAll();
+                            releaseMultiReader();
+                        }
+                    }
                 }
             } catch (IOException e) {
                 log.error("Unable to commit volatile index", e);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Recovery.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Recovery.java?rev=801226&r1=801225&r2=801226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Recovery.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/Recovery.java
Wed Aug  5 13:31:59 2009
@@ -170,5 +170,6 @@
 
         // now we are consistent again -> flush
         index.flush();
+        index.releaseMultiReader();
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=801226&r1=801225&r2=801226&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Wed Aug  5 13:31:59 2009
@@ -755,9 +755,6 @@
         try {
             index.getIndexingQueue().waitUntilEmpty();
             index.flush();
-            // flush may have pushed nodes into the indexing queue
-            // -> wait again
-            index.getIndexingQueue().waitUntilEmpty();
         } catch (IOException e) {
             throw new RepositoryException("Failed to flush the index", e);
         }



Mime
View raw message