jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r485714 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: RepositoryImpl.java cluster/ClusterNode.java cluster/FileJournal.java
Date Mon, 11 Dec 2006 15:30:25 GMT
Author: dpfister
Date: Mon Dec 11 07:30:24 2006
New Revision: 485714

URL: http://svn.apache.org/viewvc?view=rev&rev=485714
Log:
JCR-623 - Clustering
+ Journal file was considered bogus
+ RepositoryImpl derived classes did not setup version manager channel; moved up

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java?view=diff&rev=485714&r1=485713&r2=485714
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/RepositoryImpl.java
Mon Dec 11 07:30:24 2006
@@ -149,7 +149,7 @@
 
     private final NamespaceRegistryImpl nsReg;
     private final NodeTypeRegistry ntReg;
-    private final VersionManager vMgr;
+    private final VersionManagerImpl vMgr;
     private final VirtualNodeTypeStateManager virtNTMgr;
 
     /**
@@ -281,6 +281,9 @@
         // init version manager
         vMgr = createVersionManager(repConfig.getVersioningConfig(),
                 delegatingDispatcher);
+        if (clusterNode != null) {
+            vMgr.setEventChannel(clusterNode);
+        }
 
         // init virtual node type manager
         virtNTMgr = new VirtualNodeTypeStateManager(getNodeTypeRegistry(),
@@ -351,8 +354,8 @@
      * @return the newly created version manager
      * @throws RepositoryException if an error occurrs
      */
-    protected VersionManager createVersionManager(VersioningConfig vConfig,
-                                                  DelegatingObservationDispatcher delegatingDispatcher)
+    protected VersionManagerImpl createVersionManager(VersioningConfig vConfig,
+                                                      DelegatingObservationDispatcher delegatingDispatcher)
             throws RepositoryException {
 
 
@@ -364,12 +367,8 @@
                 nsReg,
                 ntReg);
 
-        VersionManagerImpl vMgr = new VersionManagerImpl(pm, fs, ntReg, delegatingDispatcher,
+        return new VersionManagerImpl(pm, fs, ntReg, delegatingDispatcher,
                 VERSION_STORAGE_NODE_ID, SYSTEM_ROOT_NODE_ID, cacheFactory);
-        if (clusterNode != null) {
-            vMgr.setEventChannel(clusterNode);
-        }
-        return vMgr;
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java?view=diff&rev=485714&r1=485713&r2=485714
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java
Mon Dec 11 07:30:24 2006
@@ -21,7 +21,6 @@
 import org.apache.jackrabbit.core.config.ClusterConfig;
 import org.apache.jackrabbit.core.config.ConfigurationException;
 import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
 import org.apache.jackrabbit.core.observation.EventState;
 import org.apache.jackrabbit.core.observation.EventStateCollection;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java?view=diff&rev=485714&r1=485713&r2=485714
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/FileJournal.java
Mon Dec 11 07:30:24 2006
@@ -76,7 +76,7 @@
     /**
      * Log extension.
      */
-    private static final String LOG_EXTENSION = ".log";
+    private static final String LOG_EXTENSION = "log";
 
     /**
      * Default base name for journal files.
@@ -134,6 +134,11 @@
     private File root;
 
     /**
+     * Journal file.
+     */
+    private File journal;
+
+    /**
      * Instance counter.
      */
     private FileRevision instanceRevision;
@@ -254,6 +259,8 @@
             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);
+
         instanceRevision = new FileRevision(new File(revision));
         globalRevision = new FileRevision(new File(root, REVISION_NAME));
 
@@ -646,13 +653,11 @@
 
             long nextRevision = record.getNextRevision();
 
-            File journalFile = new File(root, basename + LOG_EXTENSION);
-
-            FileRecordLog recordLog = new FileRecordLog(journalFile);
+            FileRecordLog recordLog = new FileRecordLog(journal);
             if (!recordLog.isNew()) {
                 if (nextRevision - recordLog.getFirstRevision() > maximumSize) {
                     switchLogs();
-                    recordLog = new FileRecordLog(journalFile);
+                    recordLog = new FileRecordLog(journal);
                 }
             }
             recordLog.append(record);



Mime
View raw message