You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2005/08/31 14:24:31 UTC
svn commit: r265028 - in
/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene:
AbstractIndex.java VolatileIndex.java
Author: mreutegg
Date: Wed Aug 31 05:24:07 2005
New Revision: 265028
URL: http://svn.apache.org/viewcvs?rev=265028&view=rev
Log:
JCR-197: Index merging should run in a separate thread
- volatile index is not optimized when written to disk
Modified:
incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java
Modified: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java?rev=265028&r1=265027&r2=265028&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java (original)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/AbstractIndex.java Wed Aug 31 05:24:07 2005
@@ -67,13 +67,13 @@
private boolean useCompoundFile = true;
/** minMergeDocs config parameter */
- private int minMergeDocs = 1000;
+ private int minMergeDocs = SearchIndex.DEFAULT_MIN_MERGE_DOCS;
/** maxMergeDocs config parameter */
- private int maxMergeDocs = 10000;
+ private int maxMergeDocs = SearchIndex.DEFAULT_MAX_MERGE_DOCS;
/** mergeFactor config parameter */
- private int mergeFactor = 10;
+ private int mergeFactor = SearchIndex.DEFAULT_MERGE_FACTOR;
/**
* The document number cache if this index may use one.
@@ -245,6 +245,8 @@
if (optimize) {
IndexWriter writer = getIndexWriter();
writer.optimize();
+ writer.close();
+ indexWriter = null;
}
}
Modified: incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java?rev=265028&r1=265027&r2=265028&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java (original)
+++ incubator/jackrabbit/trunk/core/src/java/org/apache/jackrabbit/core/query/lucene/VolatileIndex.java Wed Aug 31 05:24:07 2005
@@ -136,10 +136,12 @@
/**
* Overwrites the implementation in {@link AbstractIndex} to commit
* pending documents.
+ * @param optimize if <code>true</code> the index is optimized after the
+ * commit.
*/
- protected synchronized void commit() throws IOException {
+ protected synchronized void commit(boolean optimize) throws IOException {
commitPending();
- super.commit();
+ super.commit(optimize);
}
/**