jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r620826 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocNumberCache.java
Date Tue, 12 Feb 2008 15:17:35 GMT
Author: mreutegg
Date: Tue Feb 12 07:17:27 2008
New Revision: 620826

URL: http://svn.apache.org/viewvc?rev=620826&view=rev
Log:
JCR-1377: Reduce memory usage of DocNumberCache

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocNumberCache.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocNumberCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocNumberCache.java?rev=620826&r1=620825&r2=620826&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocNumberCache.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocNumberCache.java
Tue Feb 12 07:17:27 2008
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.core.query.lucene;
 
 import org.apache.commons.collections.map.LRUMap;
+import org.apache.jackrabbit.uuid.UUID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -93,8 +94,9 @@
      */
     void put(String uuid, CachingIndexReader reader, int n) {
         LRUMap cacheSegment = docNumbers[getSegmentIndex(uuid.charAt(0))];
+        UUID key = UUID.fromString(uuid);
         synchronized (cacheSegment) {
-            Entry e = (Entry) cacheSegment.get(uuid);
+            Entry e = (Entry) cacheSegment.get(key);
             if (e != null) {
                 // existing entry
                 // ignore if reader is older than the one in entry
@@ -112,7 +114,7 @@
             }
 
             if (e != null) {
-                cacheSegment.put(uuid, e);
+                cacheSegment.put(key, e);
             }
         }
     }
@@ -126,9 +128,10 @@
      */
     Entry get(String uuid) {
         LRUMap cacheSegment = docNumbers[getSegmentIndex(uuid.charAt(0))];
+        UUID key = UUID.fromString(uuid);
         Entry entry;
         synchronized (cacheSegment) {
-            entry = (Entry) cacheSegment.get(uuid);
+            entry = (Entry) cacheSegment.get(key);
         }
         if (log.isInfoEnabled()) {
             accesses++;



Mime
View raw message