jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1461193 - /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java
Date Tue, 26 Mar 2013 15:51:12 GMT
Author: mreutegg
Date: Tue Mar 26 15:51:12 2013
New Revision: 1461193

URL: http://svn.apache.org/r1461193
Log:
OAK-619 Lock-free MongoMK implementation
- read pending branches in init()

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java?rev=1461193&r1=1461192&r2=1461193&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/prototype/MongoMK.java
Tue Mar 26 15:51:12 2013
@@ -201,6 +201,23 @@ public class MongoMK implements MicroKer
             n = new Node("/", headRevision);
             commit.addNode(n);
             commit.applyToDocumentStore();
+        } else {
+            // initialize branchCommits
+            Map<String, Object> nodeMap = store.find(
+                    DocumentStore.Collection.NODES, Utils.getIdFromPath("/"));
+            @SuppressWarnings("unchecked")
+            Map<String, String> valueMap = (Map<String, String>) nodeMap.get(UpdateOp.REVISIONS);
+            if (valueMap != null) {
+                for (Map.Entry<String, String> commit : valueMap.entrySet()) {
+                    if (!commit.getValue().equals("true")) {
+                        Revision r = Revision.fromString(commit.getKey());
+                        if (r.getClusterId() == clusterId) {
+                            Revision b = Revision.fromString(commit.getValue());
+                            branchCommits.put(r, b);
+                        }
+                    }
+                }
+            }
         }
     }
     



Mime
View raw message