jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1466864 - /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
Date Thu, 11 Apr 2013 12:53:42 GMT
Author: mreutegg
Date: Thu Apr 11 12:53:41 2013
New Revision: 1466864

URL: http://svn.apache.org/r1466864
Log:
OAK-619 Lock-free MongoMK implementation
- Clean up TODOs and unused code

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

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java?rev=1466864&r1=1466863&r2=1466864&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoMK.java
Thu Apr 11 12:53:41 2013
@@ -58,13 +58,13 @@ import com.mongodb.DB;
  */
 public class MongoMK implements MicroKernel {
 
+    private static final Logger LOG = LoggerFactory.getLogger(MongoMK.class);
+
     /**
      * The number of documents to cache.
      */
     static final int CACHE_DOCUMENTS = Integer.getInteger("oak.mongoMK.cacheDocs", 20 * 1024);
 
-    private static final Logger LOG = LoggerFactory.getLogger(MongoMK.class);
-
     /**
      * The number of child node list entries to cache.
      */
@@ -778,7 +778,7 @@ public class MongoMK implements MicroKer
         revisionId = revisionId != null ? revisionId : headRevision.toString();
         if (revisionId.startsWith("b")) {
             // reading from the branch is reading from the trunk currently
-            revisionId = revisionId.substring(1).replace('+', ' ').trim();
+            revisionId = stripBranchRevMarker(revisionId);
         }
         Revision rev = Revision.fromString(revisionId);
         Node n = getNode(path, rev);
@@ -1124,8 +1124,7 @@ public class MongoMK implements MicroKer
             throw new MicroKernelException("Not a branch: " + branchRevisionId);
         }
 
-        // reading from the branch is reading from the trunk currently
-        String revisionId = branchRevisionId.substring(1).replace('+', ' ').trim();
+        String revisionId = stripBranchRevMarker(branchRevisionId);
         // make branch commits visible
         List<Revision> branchRevisions = new ArrayList<Revision>();
         UpdateOp op = new UpdateOp("/", Utils.getIdFromPath("/"), false);
@@ -1142,14 +1141,6 @@ public class MongoMK implements MicroKer
         }
         headRevision = newRevision();
         return headRevision.toString();
-
-        // TODO improve implementation if needed
-        // if (!branchRevisionId.startsWith("b")) {
-        //     throw new MicroKernelException("Not a branch: " + branchRevisionId);
-        // }
-        //
-        // String commit = branchCommits.remove(branchRevisionId);
-        // return commit("", commit, null, null);
     }
 
     @Override



Mime
View raw message