lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r827011 - in /lucene/java/branches/lucene_2_9: CHANGES.txt src/java/org/apache/lucene/index/IndexWriter.java
Date Tue, 20 Oct 2009 09:06:12 GMT
Author: mikemccand
Date: Tue Oct 20 09:06:11 2009
New Revision: 827011

URL: http://svn.apache.org/viewvc?rev=827011&view=rev
Log:
LUCENE-1995: don't let IndexWriter's ram buffer size exceed 2048 MB

Modified:
    lucene/java/branches/lucene_2_9/CHANGES.txt
    lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java

Modified: lucene/java/branches/lucene_2_9/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/CHANGES.txt?rev=827011&r1=827010&r2=827011&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/CHANGES.txt (original)
+++ lucene/java/branches/lucene_2_9/CHANGES.txt Tue Oct 20 09:06:11 2009
@@ -22,6 +22,10 @@
  * LUCENE-1992: Fix thread hazard if a merge is committing just as an
    exception occurs during sync (Uwe Schindler, Mike McCandless)
 
+ * LUCENE-1995: Note in javadocs that IndexWriter.setRAMBufferSizeMB
+   cannot exceed 2048 MB, and throw IllegalArgumentException if it
+   does.  (Aaron McKee, Yonik Seeley, Mike McCandless)
+
 API Changes
 
  * Un-deprecate search(Weight weight, Filter filter, int n) from

Modified: lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java?rev=827011&r1=827010&r2=827011&view=diff
==============================================================================
--- lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/branches/lucene_2_9/src/java/org/apache/lucene/index/IndexWriter.java Tue
Oct 20 09:06:11 2009
@@ -1851,6 +1851,14 @@
    * instead of RAM usage (each buffered delete Query counts
    * as one).
    *
+   * <p> <b>NOTE</b>: because IndexWriter uses
+   * <code>int</code>s when managing its internal storage,
+   * the absolute maximum value for this setting is somewhat
+   * less than 2048 MB.  The precise limit depends on
+   * various factors, such as how large your documents are,
+   * how many fields have norms, etc., so it's best to set
+   * this value comfortably under 2048.</p>
+   *
    * <p> The default value is {@link #DEFAULT_RAM_BUFFER_SIZE_MB}.</p>
    * 
    * @throws IllegalArgumentException if ramBufferSize is
@@ -1858,6 +1866,9 @@
    * when maxBufferedDocs is already disabled
    */
   public void setRAMBufferSizeMB(double mb) {
+    if (mb > 2048.0) {
+      throw new IllegalArgumentException("ramBufferSize " + mb + " is too large; should be
comfortably less than 2048");
+    }
     if (mb != DISABLE_AUTO_FLUSH && mb <= 0.0)
       throw new IllegalArgumentException(
           "ramBufferSize should be > 0.0 MB when enabled");



Mime
View raw message