Author: chetanm
Date: Thu Sep 15 07:16:53 2016
New Revision: 1760846

URL: http://svn.apache.org/viewvc?rev=1760846&view=rev
Log:
OAK-4412 - Lucene hybrid index

Synchronize the close call to ensure concurrent close does not cause issue

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

Modified: 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndex.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndex.java?rev=1760846&r1=1760845&r2=1760846&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndex.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndex.java
 Thu Sep 15 07:16:53 2016
@@ -110,12 +110,14 @@ public class NRTIndex implements Closeab
         return refreshPolicy;
     }
 
-    public void close() throws IOException {
+    public synchronized void close() throws IOException {
         if (closed) {
             return;
         }
-
         if (indexWriter != null) {
+            //TODO Close call can possibly be speeded up by
+            //avoiding merge and dropping stuff in memory. To be explored
+            //indexWrite.close(waitForMerges)
             indexWriter.close();
             directory.close();
             FileUtils.deleteQuietly(indexDir);


Reply via email to