lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sh...@apache.org
Subject svn commit: r1062824 - in /lucene/dev/branches/branch_3x/lucene: CHANGES.txt src/java/org/apache/lucene/index/SegmentDeletes.java
Date Mon, 24 Jan 2011 15:17:43 GMT
Author: shaie
Date: Mon Jan 24 15:17:42 2011
New Revision: 1062824

URL: http://svn.apache.org/viewvc?rev=1062824&view=rev
Log:
LUCENE-2693: Add delete term and query need to more precisely record the bytes used

Modified:
    lucene/dev/branches/branch_3x/lucene/CHANGES.txt
    lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/SegmentDeletes.java

Modified: lucene/dev/branches/branch_3x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/CHANGES.txt?rev=1062824&r1=1062823&r2=1062824&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_3x/lucene/CHANGES.txt Mon Jan 24 15:17:42 2011
@@ -362,6 +362,9 @@ Bug fixes
   internally, it now calls Similarity.idfExplain(Collection, IndexSearcher).
   (Robert Muir)
 
+* LUCENE-2693: RAM used by IndexWriter was slightly incorrectly computed. 
+  (Jason Rutherglen via Shai Erera)
+
 New features
 
 * LUCENE-2128: Parallelized fetching document frequencies during weight

Modified: lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/SegmentDeletes.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/SegmentDeletes.java?rev=1062824&r1=1062823&r2=1062824&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/SegmentDeletes.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/SegmentDeletes.java
Mon Jan 24 15:17:42 2011
@@ -140,8 +140,11 @@ class SegmentDeletes {
   }
 
   public void addQuery(Query query, int docIDUpto) {
-    queries.put(query, docIDUpto);
-    bytesUsed.addAndGet(BYTES_PER_DEL_QUERY);
+    Integer current = queries.put(query, docIDUpto);
+    // increment bytes used only if the query wasn't added so far.
+    if (current == null) {
+      bytesUsed.addAndGet(BYTES_PER_DEL_QUERY);
+    }
   }
 
   public void addDocID(int docID) {



Mime
View raw message