jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r517141 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal: AbstractJournal.java FileJournal.java
Date Mon, 12 Mar 2007 09:19:00 GMT
Author: dpfister
Date: Mon Mar 12 02:18:59 2007
New Revision: 517141

URL: http://svn.apache.org/viewvc?view=rev&rev=517141
Log:
JCR-785 - Updates to multiple workspaces (e.g. in a transaction) locked in cluster journal

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractJournal.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/FileJournal.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractJournal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractJournal.java?view=diff&rev=517141&r1=517140&r2=517141
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractJournal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractJournal.java
Mon Mar 12 02:18:59 2007
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.core.journal;
 
 import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
-import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
+import EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock;
 
 import java.util.Map;
 import java.util.HashMap;
@@ -29,7 +29,7 @@
 import org.apache.jackrabbit.name.NamespaceResolver;
 
 /**
- * Base implementation for a journal.
+ * Base journal implementation.
  */
 public abstract class AbstractJournal implements Journal {
 
@@ -59,9 +59,10 @@
     private final Map producers = new HashMap();
 
     /**
-     * Read
+     * Journal lock, allowing multiple readers (synchronizing their contents)
+     * but only one writer (appending a new entry).
      */
-    private final ReadWriteLock rwLock = new WriterPreferenceReadWriteLock();
+    private final ReadWriteLock rwLock = new ReentrantWriterPreferenceReadWriteLock();
 
     /**
      * {@inheritDoc}
@@ -208,6 +209,7 @@
 
     /**
      * Return an iterator over all records after the specified revision.
+     * Subclass responsibility.
      *
      * @param startRevision start point (exlusive)
      * @throws JournalException if an error occurs

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/FileJournal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/FileJournal.java?view=diff&rev=517141&r1=517140&r2=517141
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/FileJournal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/FileJournal.java
Mon Mar 12 02:18:59 2007
@@ -28,7 +28,17 @@
 import java.io.IOException;
 
 /**
- * Default file-based journal implementation.
+ * File-based journal implementation that appends journal records to a single
+ * file.<p/>
+ * It is configured through the following properties:
+ * <ul>
+ * <li><code>directory</code>: the directory where to keep the journal
file as
+ * well as the rotated files; this is a required property with no default value</li>
+ * <li><code>basename</code>: the basename of journal files; the default
+ * value is {@link #DEFAULT_BASENAME}</li>
+ * <li><code>maximumSize</code>: the maximum size of an active journal
file
+ * before rotating it: the default value is {@link #DEFAULT_MAXSIZE} </li>
+ * </ul>
  */
 public class FileJournal extends AbstractJournal {
 



Mime
View raw message