You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by dp...@apache.org on 2012/04/26 15:48:02 UTC

svn commit: r1330851 - /jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java

Author: dpfister
Date: Thu Apr 26 13:48:02 2012
New Revision: 1330851

URL: http://svn.apache.org/viewvc?rev=1330851&view=rev
Log:
GC for revisions
- javadoc

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.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=1330851&r1=1330850&r2=1330851&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 Thu Apr 26 13:48:02 2012
@@ -113,8 +113,7 @@ public class DefaultRevisionStore extend
         }
 
         initialCacheSize = determineInitialCacheSize();
-        cache = Collections.synchronizedMap(SimpleLRUCache
-                .<Id, Object> newInstance(initialCacheSize));
+        cache = Collections.synchronizedMap(SimpleLRUCache.<Id, Object> newInstance(initialCacheSize));
 
         // make sure we've got a HEAD commit
         head = pm.readHead();
@@ -491,6 +490,7 @@ public class DefaultRevisionStore extend
             if (firstBranchRootId != null && firstBranchRootId.compareTo(firstCommitId) < 0) {
                 firstCommitId = firstBranchRootId;
             }
+            /* repair dangling parent commit of first, preserved commit */
             StoredCommit commit = getCommit(firstCommitId);
             if (commit.getParentId() != null) {
                 MutableCommit firstCommit = new MutableCommit(commit);
@@ -575,8 +575,11 @@ public class DefaultRevisionStore extend
     
     /**
      * Mark all commits and nodes in a garbage collection cycle. Can be
-     * customized by subclasses. If this method throws an exception, the cycle
-     * will be stopped without sweeping.
+     * customized by subclasses. The default implementation preserves all
+     * commits that were created within 60 minutes of the current head commit.
+     * <p/>
+     * If this method throws an exception, the cycle will be stopped without
+     * sweeping.
      * 
      * @return first commit id that will be preserved
      * @throws Exception