jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1169712 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/Cache.java
Date Mon, 12 Sep 2011 12:36:49 GMT
Author: thomasm
Date: Mon Sep 12 12:36:48 2011
New Revision: 1169712

URL: http://svn.apache.org/viewvc?rev=1169712&view=rev
Log:
Cache (access order)

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/Cache.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/Cache.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/Cache.java?rev=1169712&r1=1169711&r2=1169712&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/Cache.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/util/Cache.java
Mon Sep 12 12:36:48 2011
@@ -26,7 +26,7 @@ public class Cache<K, V extends Cache.Va
     AtomicInteger memoryUsed = new AtomicInteger();
     private final Backend<K, V> backend;
 
-    private final Map<K, V> map = new LinkedHashMap<K, V>() {
+    private final Map<K, V> map = new LinkedHashMap<K, V>(1024, 0.75f, true)
{
 
         private static final long serialVersionUID = 1L;
 
@@ -143,4 +143,16 @@ public class Cache<K, V extends Cache.Va
         }
     }
 
+    public int size() {
+        return map.size();
+    }
+
+    public int getMemoryUsed() {
+        return memoryUsed.get();
+    }
+
+    public int getMemoryMax() {
+        return maxMemoryBytes;
+    }
+
 }



Mime
View raw message