jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1421786 - in /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl: MongoNodeStore.java action/FetchNodesActionNew.java
Date Fri, 14 Dec 2012 10:32:20 GMT
Author: meteatamel
Date: Fri Dec 14 10:32:20 2012
New Revision: 1421786

URL: http://svn.apache.org/viewvc?rev=1421786&view=rev
Log:
Cache the fetched nodes as well

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoNodeStore.java
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoNodeStore.java?rev=1421786&r1=1421785&r2=1421786&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoNodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/MongoNodeStore.java
Fri Dec 14 10:32:20 2012
@@ -216,7 +216,7 @@ public class MongoNodeStore implements N
         long revisionId = node.getRevisionId();
         String path = node.getPath();
         String branchId = node.getBranchId();
-        String key = path + "@" + branchId + "@" + revisionId;
+        String key = path + "*" + branchId + "*" + revisionId;
         if (!nodeCache.containsKey(key)) {
             LOG.debug("Adding node to cache: {}", key);
             nodeCache.put(key, node);
@@ -232,7 +232,7 @@ public class MongoNodeStore implements N
      * @return
      */
     public MongoNode getFromCache(String path, String branchId, long revisionId) {
-        String key = path + "@" + branchId + "@" + revisionId;
+        String key = path + "*" + branchId + "*" + revisionId;
         MongoNode node = nodeCache.get(key);
         if (node == null) {
             return null;

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java?rev=1421786&r1=1421785&r2=1421786&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/action/FetchNodesActionNew.java
Fri Dec 14 10:32:20 2012
@@ -111,7 +111,11 @@ public class FetchNodesActionNew extends
         }
 
         DBCursor dbCursor = performQuery();
-        return getMostRecentValidNodes(dbCursor);
+        Map<String, MongoNode> nodes = getMostRecentValidNodes(dbCursor);
+        for (MongoNode node : nodes.values()) {
+            nodeStore.cache(node);
+        }
+        return nodes;
     }
 
     private DBCursor performQuery() {



Mime
View raw message