LUCENE-2693: Add delete term and query need to more precisely record the bytes used (trunk)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1062832 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2011-01-24 15:35:55 +00:00
parent 2ea5e65959
commit 047d76bf6a
2 changed files with 8 additions and 2 deletions

View File

@ -689,6 +689,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

View File

@ -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) {