jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r1331337 - in /jackrabbit/oak/trunk/oak-mk/src: main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java
Date Fri, 27 Apr 2012 10:18:28 GMT
Author: dpfister
Date: Fri Apr 27 10:18:28 2012
New Revision: 1331337

URL: http://svn.apache.org/viewvc?rev=1331337&view=rev
Log:
GC for revisions
- merge on non-trivial changes to actually have new master revisions

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
    jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java?rev=1331337&r1=1331336&r2=1331337&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
Fri Apr 27 10:18:28 2012
@@ -489,7 +489,7 @@ public class DefaultRevisionStore extend
             if (firstBranchRootId != null && firstBranchRootId.compareTo(firstCommitId)
< 0) {
                 firstCommitId = firstBranchRootId;
             }
-            /* repair dangling parent commit of first, preserved commit */
+            /* repair dangling parent commit of first preserved commit */
             StoredCommit commit = getCommit(firstCommitId);
             if (commit.getParentId() != null) {
                 MutableCommit firstCommit = new MutableCommit(commit);

Modified: jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java?rev=1331337&r1=1331336&r2=1331337&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/test/java/org/apache/jackrabbit/mk/store/DefaultRevisionStoreTest.java
Fri Apr 27 10:18:28 2012
@@ -151,7 +151,7 @@ public class DefaultRevisionStoreTest {
     }
 
     /**
-     * Verify garbage collection can run concurrently with commits.
+     * Verify garbage collection can run concurrently with branch & merge.
      * 
      * @throws Exception if an error occurs
      */
@@ -171,9 +171,15 @@ public class DefaultRevisionStoreTest {
         try {
             for (int i = 0; i < 20; i++) {
                 String branchId = mk.branch(mk.getHeadRevision());
-                branchId = mk.commit("/a/b/c/d", "+\"e\" : {}", branchId, null);
-                Thread.sleep(10);
-                branchId = mk.commit("/a/b/c/d", "-\"e\"", branchId, null);
+                if ((i & 1) == 0) {
+                    /* add some data in even runs */
+                    branchId = mk.commit("/a/b/c/d", "+\"e\" : {}", branchId, null);
+                    Thread.sleep(10);
+                    branchId = mk.commit("/a/b/c/d/e", "+\"f\" : {}", branchId, null);
+                } else {
+                    /* remove added data in odd runs */
+                    branchId = mk.commit("/a/b/c/d", "-\"e\"", branchId, null);
+                }
                 Thread.sleep(30);
                 mk.merge(branchId, null);
             }



Mime
View raw message