jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r501591 - /jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/
Date Tue, 30 Jan 2007 21:53:35 GMT
Author: jukka
Date: Tue Jan 30 13:53:33 2007
New Revision: 501591

URL: http://svn.apache.org/viewvc?view=rev&rev=501591
Log:
1.2: Merged revisions 495239 and 495240 (JCR-702, JCR-703, and JCR-712)

Added:
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/AbstractJournal.java
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/AbstractJournal.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/DatabaseJournal.java
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/DatabaseJournal.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/Record.java
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/Record.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordInput.java
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordInput.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordOutput.java
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordOutput.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/default.ddl
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/default.ddl
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/derby.ddl
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/derby.ddl
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/h2.ddl
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/h2.ddl
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/oracle.ddl
      - copied unchanged from r495240, jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/oracle.ddl
Removed:
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordInput.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordOutput.java
Modified:
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecord.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordCursor.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordLog.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRevision.java
    jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordProcessor.java

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java?view=diff&rev=501591&r1=501590&r2=501591
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java (original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java Tue Jan 30 13:53:33 2007
@@ -320,7 +320,6 @@
 
     /**
      * Return the instance id to be used for this node in the cluster.
-     *
      * @param id configured id, <code>null</code> to take random id
      */
     private String getClusterNodeId(String id) {

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java?view=diff&rev=501591&r1=501590&r2=501591
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java (original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java Tue Jan 30 13:53:33 2007
@@ -16,60 +16,45 @@
  */
 package org.apache.jackrabbit.core.cluster;
 
-import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
-import org.apache.jackrabbit.core.nodetype.compact.ParseException;
-import org.apache.jackrabbit.core.state.ChangeLog;
-import org.apache.jackrabbit.core.state.ItemState;
-import org.apache.jackrabbit.core.state.NodeState;
-import org.apache.jackrabbit.core.state.PropertyState;
-import org.apache.jackrabbit.core.observation.EventState;
-import org.apache.jackrabbit.core.observation.EventStateCollection;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.NoPrefixDeclaredException;
-import org.apache.jackrabbit.name.NameException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+import java.io.DataOutputStream;
 import java.util.Arrays;
 import java.util.Comparator;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.Collection;
-
-import EDU.oswego.cs.dl.util.concurrent.Mutex;
-
-import javax.jcr.observation.Event;
-import javax.jcr.Session;
 
 /**
  * File-based journal implementation. A directory specified as <code>directory</code>
  * bean property will contain log files and a global revision file, containing the
- * latest revision file. When the current log file's size exceeds <code>maxSize</code>
+ * next available revision. When the current log file's size exceeds <code>maxSize</code>
  * bytes, it gets renamed to its name appended by '1'. At the same time, all log files
  * already having a version counter, get their version counter incremented by <code>1</code>.
  * <p/>
  * It is configured through the following properties:
  * <ul>
- * <li><code>directory</code>: the shared directory where journal logs and read from
- * and written to; this is a required property with no default value</li>
  * <li><code>revision</code>: the filename where the parent cluster node's revision
  * file should be written to; this is a required property with no default value</li>
+ * <li><code>directory</code>: the shared directory where journal logs and read from
+ * and written to; this is a required property with no default value</li>
  * <li><code>basename</code>: this is the basename of the journal logs created in
  * the shared directory; its default value is <code>journal</code></li>
  * <li><code>maximumSize</code>: this is the maximum size in bytes of a journal log
  * before a new log will be created; its default value is <code>1048576</code> (1MB)</li>
  * </ul>
+ * <p/>
+ * Technically, the global revision file contains the cumulated file position, i.e. if
+ * there are <code>N</code> journal files, with file lengths <code>L[1]</code>...
+ * <code>L[N]</code> (excluding the size of the file headers), then the global revision
+ * will be L[1]+...+L[N].
  *
  * todo after some iterations, old files should be automatically compressed to save space
  */
-public class FileJournal implements Journal {
+public class FileJournal extends AbstractJournal {
 
     /**
      * Global revision counter name, located in the journal directory.
@@ -97,31 +82,11 @@
     private static Logger log = LoggerFactory.getLogger(FileJournal.class);
 
     /**
-     * Journal id.
-     */
-    private String id;
-
-    /**
-     * Namespace resolver used to map prefixes to URIs and vice-versa.
-     */
-    private NamespaceResolver resolver;
-
-    /**
-     * Record processor.
-     */
-    private RecordProcessor processor;
-
-    /**
      * Directory name, bean property.
      */
     private String directory;
 
     /**
-     * Revision file name, bean property.
-     */
-    private String revision;
-
-    /**
      * Journal file base name, bean property.
      */
     private String basename;
@@ -142,39 +107,14 @@
     private File journal;
 
     /**
-     * Instance counter.
-     */
-    private FileRevision instanceRevision;
-
-    /**
-     * Global journal counter.
+     * Global revision counter.
      */
     private FileRevision globalRevision;
 
     /**
-     * Mutex used when writing journal.
-     */
-    private final Mutex writeMutex = new Mutex();
-
-    /**
-     * Current temporary journal log.
+     * Id as byte array.
      */
-    private File tempLog;
-
-    /**
-     * Current file record output.
-     */
-    private FileRecordOutput out;
-
-    /**
-     * Current file record.
-     */
-    private FileRecord record;
-
-    /**
-     * Last used session for event sources.
-     */
-    private Session lastSession;
+    private byte[] rawId;
 
     /**
      * Bean getter for journal directory.
@@ -193,22 +133,6 @@
     }
 
     /**
-     * Bean getter for revision file.
-     * @return revision file
-     */
-    public String getRevision() {
-        return revision;
-    }
-
-    /**
-     * Bean setter for journal directory.
-     * @param revision directory used for journaling
-     */
-    public void setRevision(String revision) {
-        this.revision = revision;
-    }
-
-    /**
      * Bean getter for base name.
      * @return base name
      */
@@ -243,19 +167,15 @@
     /**
      * {@inheritDoc}
      */
-    public void init(String id, RecordProcessor processor, NamespaceResolver resolver) throws JournalException {
-        this.id = id;
-        this.resolver = resolver;
-        this.processor = processor;
+    public void init(String id, RecordProcessor processor, NamespaceResolver resolver)
+            throws JournalException {
+        
+        super.init(id, processor, resolver);
 
         if (directory == null) {
             String msg = "Directory not specified.";
             throw new JournalException(msg);
         }
-        if (revision == null) {
-            String msg = "Revision not specified.";
-            throw new JournalException(msg);
-        }
         if (basename == null) {
             basename = DEFAULT_BASENAME;
         }
@@ -267,9 +187,14 @@
             String msg = "Directory specified does either not exist or is not a directory: " + directory;
             throw new JournalException(msg);
         }
-        journal = new File(root, basename + "." + LOG_EXTENSION);
+        try {
+            rawId = toRawId(id);
+        } catch (IOException e) {
+            String msg = "Unable to convert '" + id + "' to its binary representation.";
+            throw new JournalException(msg, e);
+        }
 
-        instanceRevision = new FileRevision(new File(revision));
+        journal = new File(root, basename + "." + LOG_EXTENSION);
         globalRevision = new FileRevision(new File(root, REVISION_NAME));
 
         log.info("FileJournal initialized at path: " + directory);
@@ -292,35 +217,28 @@
             }
         });
 
-        long instanceValue = instanceRevision.get();
+        long instanceValue = getLocalRevision();
         long globalValue = globalRevision.get();
 
         if (instanceValue < globalValue) {
-            FileRecordCursor cursor = new FileRecordCursor(logFiles,
-                    instanceValue, globalValue);
+            FileRecordCursor cursor = new FileRecordCursor(logFiles, instanceValue, globalValue);
             try {
                 while (cursor.hasNext()) {
                     FileRecord record = cursor.next();
-                    if (!record.getCreator().equals(id)) {
+                    if (!Arrays.equals(rawId, record.getCreator())) {
                         process(record);
                     } else {
                         log.info("Log entry matches journal id, skipped: " + record.getRevision());
                     }
-                    instanceRevision.set(record.getNextRevision());
+                    setLocalRevision(record.getNextRevision());
                 }
             } catch (IOException e) {
-                String msg = "Unable to iterate over modified records: " + e.getMessage();
+                String msg = "Unable to iterate over modified records.";
                 throw new JournalException(msg, e);
-
             } finally {
-                try {
-                    cursor.close();
-                } catch (IOException e) {
-                    String msg = "I/O error while closing record cursor: " + e.getMessage();
-                    log.warn(msg);
-                }
+                cursor.close();
             }
-            log.info("Sync finished, instance revision is: " + instanceRevision.get());
+            log.info("Sync finished, instance revision is: " + getLocalRevision());
         }
     }
 
@@ -330,89 +248,11 @@
      * @param record record to process
      * @throws JournalException if an error occurs
      */
-    void process(FileRecord record) throws JournalException {
-        log.info("Processing revision: " + record.getRevision());
-
-        FileRecordInput in = record.getInput(resolver);
-        String workspace = null;
+    private void process(FileRecord record) throws JournalException {
+        RecordInput in = record.getInput(resolver);
 
         try {
-            workspace = in.readString();
-            processor.start(workspace);
-
-            for (;;) {
-                char c = in.readChar();
-                if (c == '\0') {
-                    break;
-                }
-                if (c == 'N') {
-                    NodeOperation operation = NodeOperation.create(in.readByte());
-                    operation.setId(in.readNodeId());
-                    processor.process(operation);
-                } else if (c == 'P') {
-                    PropertyOperation operation = PropertyOperation.create(in.readByte());
-                    operation.setId(in.readPropertyId());
-                    processor.process(operation);
-                } else if (c == 'E') {
-                    int type = in.readByte();
-                    NodeId parentId = in.readNodeId();
-                    Path parentPath = in.readPath();
-                    NodeId childId = in.readNodeId();
-                    Path.PathElement childRelPath = in.readPathElement();
-                    QName ntName = in.readQName();
-
-                    Set mixins = new HashSet();
-                    int mixinCount = in.readInt();
-                    for (int i = 0; i < mixinCount; i++) {
-                        mixins.add(in.readQName());
-                    }
-                    String userId = in.readString();
-                    processor.process(createEventState(type, parentId, parentPath, childId,
-                            childRelPath, ntName, mixins, userId));
-                } else if (c == 'L') {
-                    NodeId nodeId = in.readNodeId();
-                    boolean isLock = in.readBoolean();
-                    if (isLock) {
-                        boolean isDeep = in.readBoolean();
-                        String owner = in.readString();
-                        processor.process(nodeId, isDeep, owner);
-                    } else {
-                        processor.process(nodeId);
-                    }
-                } else if (c == 'S') {
-                    String oldPrefix = in.readString();
-                    String newPrefix = in.readString();
-                    String uri = in.readString();
-                    processor.process(oldPrefix, newPrefix, uri);
-                } else if (c == 'T') {
-                    int size = in.readInt();
-                    HashSet ntDefs = new HashSet();
-                    for (int i = 0; i < size; i++) {
-                        ntDefs.add(in.readNodeTypeDef());
-                    }
-                    processor.process(ntDefs);
-                } else {
-                    throw new IllegalArgumentException("Unknown entry type: " + c);
-                }
-            }
-            processor.end();
-
-        } catch (NameException e) {
-            String msg = "Unable to read revision " + record.getRevision() +
-                    ": " + e.getMessage();
-            throw new JournalException(msg);
-        } catch (ParseException e) {
-            String msg = "Unable to read revision " + record.getRevision() +
-                    ": " + e.getMessage();
-            throw new JournalException(msg);
-        } catch (IOException e) {
-            String msg = "Unable to read revision " + record.getRevision() +
-                    ": " + e.getMessage();
-            throw new JournalException(msg);
-        } catch (IllegalArgumentException e) {
-            String msg = "Error while processing revision " +
-                    record.getRevision() + ": " + e.getMessage();
-            throw new JournalException(msg);
+            process(record.getRevision(), in);
         } finally {
             in.close();
         }
@@ -421,286 +261,37 @@
     /**
      * {@inheritDoc}
      */
-    public void begin(String workspace) throws JournalException {
-        try {
-            writeMutex.acquire();
-        } catch (InterruptedException e) {
-            String msg = "Interrupted while waiting for write lock.";
-            throw new JournalException(msg);
-        }
-
-        boolean succeeded = false;
-
-        try {
-            sync();
-
-            tempLog = File.createTempFile("journal", ".tmp", root);
-
-            record = new FileRecord(id, tempLog);
-            out = record.getOutput(resolver);
-            out.writeString(workspace);
-
-            succeeded = true;
-        } catch (IOException e) {
-            String msg = "Unable to create journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        } finally {
-            if (!succeeded) {
-                writeMutex.release();
-            }
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void log(ChangeLog changeLog, EventStateCollection esc) throws JournalException {
-        Iterator addedStates = changeLog.addedStates();
-        while (addedStates.hasNext()) {
-            ItemState state = (ItemState) addedStates.next();
-            if (state.isNode()) {
-                log(NodeAddedOperation.create((NodeState) state));
-            } else {
-                log(PropertyAddedOperation.create((PropertyState) state));
-            }
-        }
-        Iterator modifiedStates = changeLog.modifiedStates();
-        while (modifiedStates.hasNext()) {
-            ItemState state = (ItemState) modifiedStates.next();
-            if (state.isNode()) {
-                log(NodeModifiedOperation.create((NodeState) state));
-            } else {
-                log(PropertyModifiedOperation.create((PropertyState) state));
-            }
-        }
-        Iterator deletedStates = changeLog.deletedStates();
-        while (deletedStates.hasNext()) {
-            ItemState state = (ItemState) deletedStates.next();
-            if (state.isNode()) {
-                log(NodeDeletedOperation.create((NodeState) state));
-            } else {
-                log(PropertyDeletedOperation.create((PropertyState) state));
-            }
-        }
-
-        Iterator events = esc.getEvents().iterator();
-        while (events.hasNext()) {
-            EventState event = (EventState) events.next();
-            log(event);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void log(String oldPrefix, String newPrefix, String uri) throws JournalException {
-        try {
-            out.writeChar('S');
-            out.writeString(oldPrefix);
-            out.writeString(newPrefix);
-            out.writeString(uri);
-        } catch (IOException e) {
-            String msg = "Unable to write to journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void log(NodeId nodeId, boolean isDeep, String owner) throws JournalException {
-        log(nodeId, true, isDeep, owner);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void log(NodeId nodeId) throws JournalException {
-        log(nodeId, false, false, null);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void log(Collection ntDefs) throws JournalException {
-        try {
-            out.writeChar('T');
-            out.writeInt(ntDefs.size());
-
-            Iterator iter = ntDefs.iterator();
-            while (iter.hasNext()) {
-                out.writeNodeTypeDef((NodeTypeDef) iter.next());
-            }
-        } catch (IOException e) {
-            String msg = "Unable to write to journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        }
-
-    }
-
-    /**
-     * Log a property operation.
-     *
-     * @param operation property operation
-     */
-    protected void log(PropertyOperation operation) throws JournalException {
-        try {
-            out.writeChar('P');
-            out.writeByte(operation.getOperationType());
-            out.writePropertyId(operation.getId());
-        } catch (NoPrefixDeclaredException e) {
-            String msg = "Unable to write to journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        } catch (IOException e) {
-            String msg = "Unable to write to journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        }
-    }
-
-    /**
-     * Log a node operation.
-     *
-     * @param operation node operation
-     */
-    protected void log(NodeOperation operation) throws JournalException {
-        try {
-            out.writeChar('N');
-            out.writeByte(operation.getOperationType());
-            out.writeNodeId(operation.getId());
-        } catch (IOException e) {
-            String msg = "Unable to write to journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        }
-    }
-
-    /**
-     * Log an event. Subclass responsibility.
-     *
-     * @param event event to log
-     */
-    protected void log(EventState event) throws JournalException {
-        try {
-            out.writeChar('E');
-            out.writeByte(event.getType());
-            out.writeNodeId(event.getParentId());
-            out.writePath(event.getParentPath());
-            out.writeNodeId(event.getChildId());
-            out.writePathElement(event.getChildRelPath());
-            out.writeQName(event.getNodeType());
-
-            Set mixins = event.getMixinNames();
-            out.writeInt(mixins.size());
-            Iterator iter = mixins.iterator();
-            while (iter.hasNext()) {
-                out.writeQName((QName) iter.next());
-            }
-            out.writeString(event.getUserId());
-        } catch (NoPrefixDeclaredException e) {
-            String msg = "Unable to write to journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        } catch (IOException e) {
-            String msg = "Unable to write to journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        }
-    }
-
-    /**
-     * Log either a lock or an unlock operation.
-     *
-     * @param nodeId node id
-     * @param isLock <code>true</code> if this is a lock;
-     *               <code>false</code> if this is an unlock
-     * @param isDeep flag indicating whether lock is deep
-     * @param owner lock owner
-     */
-    protected void log(NodeId nodeId, boolean isLock, boolean isDeep, String owner)
-            throws JournalException {
-
-        try {
-            out.writeChar('L');
-            out.writeNodeId(nodeId);
-            out.writeBoolean(isLock);
-            if (isLock) {
-                out.writeBoolean(isDeep);
-                out.writeString(owner);
-            }
-        } catch (IOException e) {
-            String msg = "Unable to write to journal log " + tempLog + ": " + e.getMessage();
-            throw new JournalException(msg);
-        }
+    protected long lockRevision() throws JournalException {
+        globalRevision.lock(false);
+        return globalRevision.get();
     }
 
     /**
      * {@inheritDoc}
      */
-    public void prepare() throws JournalException {
-        globalRevision.lock(false);
-
-        boolean prepared = false;
-
-        try {
-            sync();
-
-            record.setRevision(globalRevision.get());
-
-            prepared = true;
-        } finally {
-            if (!prepared) {
-                globalRevision.unlock();
-                writeMutex.release();
-            }
-        }
+    protected void unlockRevision(boolean successful) {
+        globalRevision.unlock();
     }
 
     /**
      * {@inheritDoc}
      */
-    public void commit() throws JournalException {
+    protected void append(long revision, File record) throws JournalException {
         try {
-            out.writeChar('\0');
-            out.close();
-
-            long nextRevision = record.getNextRevision();
-
             FileRecordLog recordLog = new FileRecordLog(journal);
             if (!recordLog.isNew()) {
-                if (nextRevision - recordLog.getFirstRevision() > maximumSize) {
+                if (revision - recordLog.getFirstRevision() > maximumSize) {
                     switchLogs();
                     recordLog = new FileRecordLog(journal);
                 }
             }
-            recordLog.append(record);
-
-            tempLog.delete();
+            long nextRevision = recordLog.append(revision, rawId, record);
             globalRevision.set(nextRevision);
-            instanceRevision.set(nextRevision);
+            setLocalRevision(nextRevision);
 
         } catch (IOException e) {
-            String msg = "Unable to close journal log " + tempLog + ": " + e.getMessage();
+            String msg = "Unable to append new record to journal " + journal + ": " + e.getMessage();
             throw new JournalException(msg);
-        } finally {
-            out = null;
-            globalRevision.unlock();
-            writeMutex.release();
-        }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void cancel() {
-        if (out != null) {
-            try {
-                out.close();
-                tempLog.delete();
-            } catch (IOException e) {
-                String msg = "Unable to close journal log " + tempLog + ": " + e.getMessage();
-                log.warn(msg);
-            } finally {
-                out = null;
-                globalRevision.unlock();
-                writeMutex.release();
-            }
         }
     }
 
@@ -710,57 +301,6 @@
     public void close() {}
 
     /**
-     * Create an event state.
-     *
-     * @param type event type
-     * @param parentId parent id
-     * @param parentPath parent path
-     * @param childId child id
-     * @param childRelPath child relative path
-     * @param ntName ndoe type name
-     * @param userId user id
-     * @return event
-     */
-    protected EventState createEventState(int type, NodeId parentId, Path parentPath,
-                                          NodeId childId, Path.PathElement childRelPath,
-                                          QName ntName, Set mixins, String userId) {
-        switch (type) {
-            case Event.NODE_ADDED:
-                return EventState.childNodeAdded(parentId, parentPath, childId, childRelPath,
-                        ntName, mixins, getOrCreateSession(userId));
-            case Event.NODE_REMOVED:
-                return EventState.childNodeRemoved(parentId, parentPath, childId, childRelPath,
-                        ntName, mixins, getOrCreateSession(userId));
-            case Event.PROPERTY_ADDED:
-                return EventState.propertyAdded(parentId, parentPath, childRelPath,
-                        ntName, mixins, getOrCreateSession(userId));
-            case Event.PROPERTY_CHANGED:
-                return EventState.propertyChanged(parentId, parentPath, childRelPath,
-                        ntName, mixins, getOrCreateSession(userId));
-            case Event.PROPERTY_REMOVED:
-                return EventState.propertyRemoved(parentId, parentPath, childRelPath,
-                        ntName, mixins, getOrCreateSession(userId));
-            default:
-                String msg = "Unexpected event type: " + type;
-                throw new IllegalArgumentException(msg);
-        }
-    }
-
-
-    /**
-     * Return a session matching a certain user id.
-     *
-     * @param userId user id
-     * @return session
-     */
-    protected Session getOrCreateSession(String userId) {
-        if (lastSession == null || !lastSession.getUserID().equals(userId)) {
-            lastSession = new ClusterSession(userId);
-        }
-        return lastSession;
-    }
-
-    /**
      * Move away current journal file (and all other files), incrementing their
      * version counter. A file named <code>journal.N.log</code> gets renamed to
      * <code>journal.(N+1).log</code>, whereas the main journal file gets renamed
@@ -800,5 +340,23 @@
                 }
             }
         }
+    }
+
+    /**
+     * Convert an id given as string, to its raw form, i.e. to its binary
+     * representation, encoded as UTF-8.
+     *
+     * @throws IOException if an I/O error occurs, which is very unlikely.
+     */
+    private static byte[] toRawId(String id) throws IOException {
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        DataOutputStream dos = new DataOutputStream(bos);
+        dos.writeUTF(id);
+        dos.close();
+
+        byte[] b = bos.toByteArray();
+        byte[] rawId = new byte[b.length - 2];
+        System.arraycopy(b, 2, rawId, 0, rawId.length);
+        return rawId;
     }
 }

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecord.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecord.java?view=diff&rev=501591&r1=501590&r2=501591
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecord.java (original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecord.java Tue Jan 30 13:53:33 2007
@@ -19,108 +19,52 @@
 import org.apache.jackrabbit.name.NamespaceResolver;
 
 import java.io.DataInputStream;
-import java.io.DataOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.DataInput;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
 
 /**
- * Represents a file-based record. Physically, a file record contains its length in the
- * first 4 bytes, immediately followed by its creator in a length-prefixed, UTF-encoded
- * string. All further fields are record-specific.
+ * Represents a file-based record. Physically, a file record starts with its creator
+ * in a length-prefixed, UTF-encoded string, followed by a 4 byte indicating the
+ * length of data. All further fields are record-specific.
  */
 class FileRecord {
 
     /**
-     * Indicator for a literal UUID.
+     * Record creator.
      */
-    static final byte UUID_LITERAL = 'L';
-
-    /**
-     * Indicator for a UUID index.
-     */
-    static final byte UUID_INDEX = 'I';
-
-    /**
-     * Revision.
-     */
-    private long revision;
-
-    /**
-     * Underlying input stream.
-     */
-    private DataInputStream in;
-
-    /**
-     * File use when creating a new record.
-     */
-    private File file;
-
-    /**
-     * Underlying output stream.
-     */
-    private DataOutputStream out;
+    //private final String creator;
+    private final byte[] creator;
 
     /**
      * Record length.
      */
-    private int length;
+    private final int length;
 
     /**
-     * Creator of a record.
+     * Input stream associated with record data.
      */
-    private String creator;
+    private final DataInputStream dataIn;
 
     /**
-     * Bytes used by creator when written in UTF encoding and length-prefixed.
+     * Revision.
      */
-    private int creatorLength;
+    private long revision;
 
     /**
-     * Flag indicating whether bytes need to be skipped at the end.
+     * Flag indicating whether the data associated with this record has been consumed.
      */
     private boolean consumed;
 
     /**
-     * Creates a new file record. Used when opening an existing record.
-     *
-     * @param revision revision this record represents
-     * @param in underlying input stream
-     * @throws IOException if reading the creator fails
-     */
-    public FileRecord(long revision, InputStream in)
-            throws IOException {
-
-        this.revision = revision;
-        if (in instanceof DataInputStream) {
-            this.in = (DataInputStream) in;
-        } else {
-            this.in = new DataInputStream(in);
-        }
-        this.length = this.in.readInt();
-
-        readCreator();
-    }
-
-    /**
-     * Creates a new file record. Used when creating a new record.
+     * Creates a new instance of this class. Used when opening an existing record.
      *
      * @param creator creator of this record
-     * @param file underlying (temporary) file
-     * @throws IOException if writing the creator fails
+     * @param length record length
+     * @param dataIn input stream containing record data
      */
-    public FileRecord(String creator, File file) throws IOException {
-
+    public FileRecord(byte[] creator, int length, DataInputStream dataIn) {
         this.creator = creator;
-        this.file = file;
-
-        this.out = new DataOutputStream(new FileOutputStream(file));
-
-        writeCreator();
+        this.length = length;
+        this.dataIn = dataIn;
     }
 
     /**
@@ -133,21 +77,24 @@
     }
 
     /**
-     * Set the journal revision associated with this record.
+     * Set the journal revision associated with this record. Called after creation
+     * of the file record.
      *
-     * @param revision journal revision
+     * @param revision revision
      */
-    public void setRevision(long revision) {
+    void setRevision(long revision) {
         this.revision = revision;
     }
 
     /**
-     * Return the journal counter associated with the next record.
+     * Return the journal counter associated with the next record. A file record's
+     * size is the size of the length-prefixed creator string plus the size of
+     * the length-prefixed data.
      *
      * @return next revision
      */
     public long getNextRevision() {
-        return revision + length + 4;
+        return revision + FileRecordLog.getRecordSize(creator, length);
     }
 
     /**
@@ -155,7 +102,7 @@
      *
      * @return creator
      */
-    public String getCreator() {
+    public byte[] getCreator() {
         return creator;
     }
 
@@ -165,41 +112,9 @@
      * @param resolver resolver to use when mapping prefixes to full names
      * @return record input
      */
-    public FileRecordInput getInput(NamespaceResolver resolver) {
+    public RecordInput getInput(NamespaceResolver resolver) {
         consumed = true;
-        return new FileRecordInput(in, resolver);
-    }
-
-    /**
-     * Return an output on this record.
-     *
-     * @param resolver resolver to use when mapping full names to prefixes
-     * @return record output
-     */
-    public FileRecordOutput getOutput(NamespaceResolver resolver) {
-        return new FileRecordOutput(this, out, resolver);
-    }
-
-    /**
-     * Append this record to some output stream.
-     *
-     * @param out outputstream to append to
-     */
-    void append(DataOutputStream out) throws IOException {
-        out.writeInt(length);
-
-        byte[] buffer = new byte[8192];
-        int len;
-
-        InputStream in = new BufferedInputStream(new FileInputStream(file));
-        try {
-            while ((len = in.read(buffer)) > 0) {
-                out.write(buffer, 0, len);
-            }
-            out.flush();
-        } finally {
-            in.close();
-        }
+        return new RecordInput(dataIn, resolver);
     }
 
     /**
@@ -208,11 +123,11 @@
      *
      * @throws IOException if an I/O error occurs
      */
-    void skip() throws IOException {
+    public void skip() throws IOException {
         if (!consumed) {
-            long skiplen = length - creatorLength;
+            long skiplen = length;
             while (skiplen > 0) {
-                long skipped = in.skip(skiplen);
+                long skipped = dataIn.skip(skiplen);
                 if (skipped <= 0) {
                     break;
                 }
@@ -222,158 +137,6 @@
                 String msg = "Unable to skip remaining bytes.";
                 throw new IOException(msg);
             }
-        }
-    }
-
-    /**
-     * Invoked when output has been closed.
-     */
-    void closed() {
-        length = (int) file.length();
-    }
-
-    /**
-     * Read creator from the underlying data input stream.
-     *
-     * @throws IOException if an I/O error occurs
-     */
-    private void readCreator() throws IOException {
-        UTFByteCounter counter = new UTFByteCounter(in);
-        creator = DataInputStream.readUTF(counter);
-        creatorLength = counter.getBytes();
-    }
-
-    /**
-     * Write creator to the underlying data output stream.
-     *
-     * @throws IOException if an I/O error occurs
-     */
-    private void writeCreator() throws IOException {
-        out.writeUTF(creator);
-    }
-
-    /**
-     * UTF byte counter. Counts the bytes actually read from a given
-     * <code>DataInputStream</code> that make up a UTF-encoded string.
-     */
-    static class UTFByteCounter implements DataInput {
-
-        /**
-         * Underlying input stream.
-         */
-        private final DataInputStream in;
-
-        /**
-         * UTF length.
-         */
-        private int bytes;
-
-        /**
-         * Create a new instance of this class.
-         *
-         * @param in underlying data input stream
-         */
-        public UTFByteCounter(DataInputStream in) {
-            this.in = in;
-        }
-
-        /**
-         * Return the number of bytes read from the underlying input stream.
-         *
-         * @return number of bytes
-         */
-        public int getBytes() {
-            return bytes;
-        }
-
-        /**
-         * @see java.io.DataInputStream#readUnsignedShort()
-         *
-         * Remember number of bytes read.
-         */
-        public int readUnsignedShort() throws IOException {
-            try {
-                return in.readUnsignedShort();
-            } finally {
-                bytes += 2;
-            }
-        }
-
-        /**
-         * @see java.io.DataInputStream#readUnsignedShort()
-         *
-         * Remember number of bytes read.
-         */
-        public void readFully(byte b[]) throws IOException {
-            try {
-                in.readFully(b);
-            } finally {
-                bytes += b.length;
-            }
-        }
-
-        /**
-         * @see java.io.DataInputStream#readUnsignedShort()
-         *
-         * Remember number of bytes read.
-         */
-        public void readFully(byte b[], int off, int len) throws IOException {
-            try {
-                in.readFully(b, off, len);
-            } finally {
-                bytes += b.length;
-            }
-        }
-
-        /**
-         * Methods not implemented.
-         */
-        public byte readByte() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public char readChar() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public double readDouble() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public float readFloat() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public int readInt() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-       }
-
-        public int readUnsignedByte() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public long readLong() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public short readShort() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public boolean readBoolean() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public int skipBytes(int n) throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public String readLine() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
-        }
-
-        public String readUTF() throws IOException {
-            throw new IllegalStateException("Unexpected call, deliberately not implemented.");
         }
     }
 }

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordCursor.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordCursor.java?view=diff&rev=501591&r1=501590&r2=501591
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordCursor.java (original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordCursor.java Tue Jan 30 13:53:33 2007
@@ -96,9 +96,9 @@
         }
         if (recordLog == null) {
             recordLog = getRecordLog(nextRevision);
-            recordLog.seek(nextRevision);
         }
-        record = new FileRecord(nextRevision, recordLog.getInputStream());
+        record = recordLog.read();
+        record.setRevision(nextRevision);
         nextRevision = record.getNextRevision();
         return record;
     }
@@ -114,6 +114,7 @@
         for (int i = 0; i < logFiles.length; i++) {
             FileRecordLog recordLog = new FileRecordLog(logFiles[i]);
             if (recordLog.contains(revision)) {
+                recordLog.seek(revision);
                 return recordLog;
             }
         }
@@ -123,10 +124,8 @@
 
     /**
      * Close this cursor, releasing its resources.
-     *
-     * @throws IOException if an I/O error occurs
      */
-    public void close() throws IOException {
+    public void close() {
         if (recordLog != null) {
             recordLog.close();
         }

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordLog.java?view=diff&rev=501591&r1=501590&r2=501591
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordLog.java (original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRecordLog.java Tue Jan 30 13:53:33 2007
@@ -16,6 +16,9 @@
  */
 package org.apache.jackrabbit.core.cluster;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.io.File;
 import java.io.DataInputStream;
 import java.io.IOException;
@@ -23,14 +26,43 @@
 import java.io.BufferedInputStream;
 import java.io.DataOutputStream;
 import java.io.FileOutputStream;
+import java.io.InputStream;
 
 /**
- * A file record log is a file containing {@link FileRecord}s. Internally,
- * the first 8 bytes contain the revision this log starts with.
+ * A file record log is a file containing {@link FileRecord}s. Physically,
+ * the first 4 bytes contain a signature, followed by a major and minor version
+ * (2 bytes each). The next 8 bytes contain the revision this log starts with.
+ * After this, zero or more <code>FileRecord</code>s follow.
  */
 class FileRecordLog {
 
     /**
+     * Logger.
+     */
+    private static Logger log = LoggerFactory.getLogger(FileRecordLog.class);
+
+    /**
+     * Record log signature.
+     */
+    private static final byte[] SIGNATURE = { 'J', 'L', 'O', 'G' };
+
+    /**
+     * Known major version.
+     */
+    private static final short MAJOR_VERSION = 1;
+
+    /**
+     * Known minor version.
+     */
+    private static final short MINOR_VERSION = 0;
+
+    /**
+     * Header size. This is the size of {@link #SIGNATURE}, {@link #MAJOR_VERSION},
+     * {@link #MINOR_VERSION} and first revision (8 bytes).
+     */
+    private static final int HEADER_SIZE = 4 + 2 + 2 + 8;
+
+    /**
      * Underlying file.
      */
     private File file;
@@ -68,8 +100,9 @@
             DataInputStream in = new DataInputStream(new FileInputStream(file));
 
             try {
+                readHeader(in);
                 minRevision = in.readLong();
-                maxRevision = minRevision + file.length() - 8;
+                maxRevision = minRevision + file.length() - HEADER_SIZE;
             } finally {
                 in.close();
             }
@@ -117,12 +150,23 @@
      */
     public void seek(long revision) throws IOException {
         if (in != null) {
-            String msg = "Seek allowed exactly once.";
+            String msg = "Stream already open: seek() only allowed once.";
             throw new IllegalStateException(msg);
         }
-        open();
+        in = new DataInputStream(new BufferedInputStream(
+                new FileInputStream(file)));
+        skip(revision - minRevision + HEADER_SIZE);
+    }
 
-        long skiplen = revision - minRevision + 8;
+    /**
+     * Skip exactly <code>n</code> bytes. Throws if less bytes are skipped.
+     *
+     * @param n bytes to skip
+     * @throws IOException if an I/O error occurs, or less that <code>n</code> bytes
+     *                     were skipped.
+     */
+    private void skip(long n) throws IOException {
+        long skiplen = n;
         while (skiplen > 0) {
             long skipped = in.skip(skiplen);
             if (skipped <= 0) {
@@ -137,54 +181,143 @@
     }
 
     /**
-     * Append a record to this log.
+     * Read the file record at the current seek position.
+     *
+     * @return file record
+     * @throws IOException if an I/O error occurs
+     */
+    public FileRecord read() throws IOException {
+        byte[] creator = new byte[in.readUnsignedShort()];
+        in.readFully(creator);
+        int length = in.readInt();
+        return new FileRecord(creator, length, in);
+    }
+
+    /**
+     * Append a record to this log. Returns the revision following this record.
      *
      * @param record record to add
+     * @return next available revision
      * @throws IOException if an I/O error occurs
      */
-    public void append(FileRecord record) throws IOException {
+    public long append(long revision, byte[] creator, File record) throws IOException {
         DataOutputStream out = new DataOutputStream(new FileOutputStream(file, true));
         try {
+            int recordLength = (int) record.length();
             if (isNew) {
-                out.writeLong(record.getRevision());
+                writeHeader(out);
+                out.writeLong(revision);
             }
-            record.append(out);
+            out.writeShort(creator.length);
+            out.write(creator);
+            out.writeInt(recordLength);
+            append(record, out);
+            return revision + getRecordSize(creator, recordLength);
         } finally {
             out.close();
         }
     }
 
     /**
-     * Open this log.
-     *
-     * @throws IOException if an I/O error occurs
+     * Close this log.
      */
-    private void open() throws IOException {
-        in = new DataInputStream(new BufferedInputStream(
-                new FileInputStream(file)));
+    public void close() {
+        try {
+            if (in != null) {
+                in.close();
+            }
+        } catch (IOException e) {
+            String msg = "Error while closing record log: " + e.getMessage();
+            log.warn(msg);
+        }
     }
 
     /**
-     * Return the underlying input stream.
+     * Return the size of a stored record . A stored record's size is the size of
+     * the length-prefixed creator string plus the size of the length-prefixed data.
      *
-     * @return underlying input stream
+     * @param creator creator string
+     * @param length data length
+     * @return size of a stored record
      */
-    protected DataInputStream getInputStream() {
-        if (in == null) {
-            String msg = "Input stream not open.";
-            throw new IllegalStateException(msg);
+    public static int getRecordSize(byte[] creator, int length) {
+        return 2 + creator.length + 4 + length;
+    }
+
+    /**
+     * Read signature and major/minor version of file and verify.
+     *
+     * @param in input stream
+     * @throws IOException if an I/O error occurs or the file does
+     *                     not have a valid header.
+     */
+    private void readHeader(DataInputStream in) throws IOException {
+        byte[] signature = new byte[SIGNATURE.length];
+        in.readFully(signature);
+
+        for (int i = 0; i < SIGNATURE.length; i++) {
+            if (signature[i] != SIGNATURE[i]) {
+                String msg = "Record log '" + file.getPath() +
+                        "' has wrong signature: " + toHexString(signature);
+                throw new IOException(msg);
+            }
+        }
+
+        short major = in.readShort();
+        in.readShort(); // minor version not used yet
+
+        if (major > MAJOR_VERSION) {
+            String msg = "Record log '" + file.getPath() +
+                    "' has incompatible major version: " + major;
+            throw new IOException(msg);
         }
-        return in;
     }
 
     /**
-     * Close this log.
+     * Write signature and major/minor.
      *
-     * @throws IOException if an I/O error occurs
+     * @param out input stream
+     * @throws IOException if an I/O error occurs.
      */
-    public void close() throws IOException {
-        if (in != null) {
+    private void writeHeader(DataOutputStream out) throws IOException {
+        out.write(SIGNATURE);
+        out.writeShort(MAJOR_VERSION);
+        out.writeShort(MINOR_VERSION);
+    }
+
+    /**
+     * Append a record to this log's output stream.
+     *
+     * @param record record to append
+     * @param out where to append to
+     */
+    private static void append(File record, DataOutputStream out) throws IOException {
+        byte[] buffer = new byte[8192];
+        int len;
+
+        InputStream in = new BufferedInputStream(new FileInputStream(record));
+        try {
+            while ((len = in.read(buffer)) > 0) {
+                out.write(buffer, 0, len);
+            }
+            out.flush();
+        } finally {
             in.close();
         }
+    }
+
+    /**
+     * Convert a byte array to its hexadecimal string representation.
+     */
+    private static String toHexString(byte[] b) {
+        StringBuffer buf = new StringBuffer();
+        for (int i = 0; i < b.length; i++) {
+            String s = Integer.toHexString(b[i] & 0xff).toUpperCase();
+            if (s.length() == 1) {
+                buf.append('0');
+            }
+            buf.append(s);
+        }
+        return buf.toString();
     }
 }

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRevision.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRevision.java?view=diff&rev=501591&r1=501590&r2=501591
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRevision.java (original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileRevision.java Tue Jan 30 13:53:33 2007
@@ -133,7 +133,7 @@
         lock(true);
 
         try {
-            long value = 0;
+            long value = 0L;
             if (raf.length() > 0) {
                 raf.seek(0L);
                 value = raf.readLong();

Modified: jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordProcessor.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordProcessor.java?view=diff&rev=501591&r1=501590&r2=501591
==============================================================================
--- jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordProcessor.java (original)
+++ jackrabbit/branches/1.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/RecordProcessor.java Tue Jan 30 13:53:33 2007
@@ -18,10 +18,6 @@
 
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.observation.EventState;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
-
-import java.util.Set;
 import java.util.Collection;
 
 /**



Mime
View raw message