lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r827010 - in /lucene/java/trunk: CHANGES.txt src/java/org/apache/lucene/index/IndexWriter.java
Date Tue, 20 Oct 2009 09:04:51 GMT
Author: mikemccand
Date: Tue Oct 20 09:04:51 2009
New Revision: 827010

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

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

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=827010&r1=827009&r2=827010&view=diff
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Tue Oct 20 09:04:51 2009
@@ -110,6 +110,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)
+
 New features
 
 * LUCENE-1933: Provide a convenience AttributeFactory that creates a

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java?rev=827010&r1=827009&r2=827010&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java Tue Oct 20 09:04:51
2009
@@ -1338,6 +1338,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
@@ -1345,6 +1353,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