jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1478772 - in /jackrabbit/oak/trunk: ./ oak-run/src/main/java/org/apache/jackrabbit/core/ oak-run/src/test/java/org/apache/jackrabbit/oak/run/ oak-upgrade/ oak-upgrade/src/ oak-upgrade/src/main/ oak-upgrade/src/main/java/ oak-upgrade/src/ma...
Date Fri, 03 May 2013 13:19:13 GMT
Author: jukka
Date: Fri May  3 13:19:11 2013
New Revision: 1478772

URL: http://svn.apache.org/r1478772
Log:
OAK-806: Content migration from Jackrabbit to Oak

Move the migration code to a separate component for easier reuse

Added:
    jackrabbit/oak/trunk/oak-upgrade/
    jackrabbit/oak/trunk/oak-upgrade/pom.xml   (with props)
    jackrabbit/oak/trunk/oak-upgrade/src/
    jackrabbit/oak/trunk/oak-upgrade/src/main/
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/PersistenceCopier.java
  (contents, props changed)
      - copied, changed from r1478756, jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/PersistenceCopier.java
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java
  (contents, props changed)
      - copied, changed from r1478756, jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/RepositoryUpgrade.java
    jackrabbit/oak/trunk/oak-upgrade/src/test/
    jackrabbit/oak/trunk/oak-upgrade/src/test/java/
    jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/
    jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/
    jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/
    jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/
    jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/
    jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java
  (contents, props changed)
      - copied, changed from r1478756, jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/RepositoryUpgradeTest.java
    jackrabbit/oak/trunk/oak-upgrade/src/test/resources/
    jackrabbit/oak/trunk/oak-upgrade/src/test/resources/logback-test.xml   (with props)
Removed:
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/PersistenceCopier.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/RepositoryUpgrade.java
    jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/RepositoryUpgradeTest.java
Modified:
    jackrabbit/oak/trunk/pom.xml

Added: jackrabbit/oak/trunk/oak-upgrade/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/pom.xml?rev=1478772&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-upgrade/pom.xml (added)
+++ jackrabbit/oak/trunk/oak-upgrade/pom.xml Fri May  3 13:19:11 2013
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd
">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.jackrabbit</groupId>
+    <artifactId>oak-parent</artifactId>
+    <version>0.7-SNAPSHOT</version>
+    <relativePath>../oak-parent/pom.xml</relativePath>
+  </parent>
+
+  <artifactId>oak-upgrade</artifactId>
+  <name>Oak upgrade</name>
+  <description>Tooling for upgrading Jackrabbit repositories to Oak</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <systemPropertyVariables>
+            <derby.stream.error.file>target/derby.log</derby.stream.error.file>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>oak-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-core</artifactId>
+      <version>${jackrabbit.version}</version>
+    </dependency>
+
+    <!-- Logging -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+
+    <!-- Findbugs annotations -->
+    <dependency>
+      <groupId>com.google.code.findbugs</groupId>
+      <artifactId>jsr305</artifactId>
+      <version>2.0.0</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <!-- Test Dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>oak-jcr</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>com.h2database</groupId>
+      <artifactId>h2</artifactId>
+      <version>1.3.158</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+</project>

Propchange: jackrabbit/oak/trunk/oak-upgrade/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/PersistenceCopier.java
(from r1478756, jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/PersistenceCopier.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/PersistenceCopier.java?p2=jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/PersistenceCopier.java&p1=jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/PersistenceCopier.java&r1=1478756&r2=1478772&rev=1478772&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/PersistenceCopier.java
(original)
+++ jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/PersistenceCopier.java
Fri May  3 13:19:11 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.core;
+package org.apache.jackrabbit.oak.upgrade;
 
 import static com.google.common.collect.Lists.newArrayListWithCapacity;
 import static org.apache.jackrabbit.JcrConstants.JCR_MIXINTYPES;

Propchange: jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/PersistenceCopier.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java
(from r1478756, jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/RepositoryUpgrade.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java?p2=jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java&p1=jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/RepositoryUpgrade.java&r1=1478756&r2=1478772&rev=1478772&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/core/RepositoryUpgrade.java
(original)
+++ jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java
Fri May  3 13:19:11 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.core;
+package org.apache.jackrabbit.oak.upgrade;
 
 import static com.google.common.collect.Lists.newArrayListWithCapacity;
 import static java.util.Arrays.asList;
@@ -136,23 +136,6 @@ public class RepositoryUpgrade {
     }
 
     /**
-     * Copies the contents of the given source repository to the given
-     * target node store.
-     * <p>
-     * The source repository <strong>must not be modified</strong> while
-     * the copy operation is running to avoid an inconsistent copy.
-     *
-     * @param source source repository directory
-     * @param target target node store
-     * @throws RepositoryException if the copy operation fails
-     * @throws IOException if the target repository can not be initialized
-     */
-    public static void copy(RepositoryImpl source, NodeStore target)
-            throws RepositoryException {
-        new RepositoryUpgrade(source.getRepositoryContext(), target).copy();
-    }
-
-    /**
      * Creates a tool for copying the full contents of the source repository
      * to the given target repository. Any existing content in the target
      * repository will be overwritten.

Propchange: jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java
(from r1478756, jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/RepositoryUpgradeTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java?p2=jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java&p1=jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/RepositoryUpgradeTest.java&r1=1478756&r2=1478772&rev=1478772&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/run/RepositoryUpgradeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java
Fri May  3 13:19:11 2013
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.jackrabbit.oak.run;
+package org.apache.jackrabbit.oak.upgrade;
 
 import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertFalse;
@@ -44,13 +44,13 @@ import javax.jcr.nodetype.NodeTypeTempla
 
 import org.apache.commons.io.FileUtils;
 import org.apache.jackrabbit.core.RepositoryImpl;
-import org.apache.jackrabbit.core.RepositoryUpgrade;
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.apache.jackrabbit.mk.core.MicroKernelImpl;
 import org.apache.jackrabbit.oak.Oak;
 import org.apache.jackrabbit.oak.jcr.Jcr;
 import org.apache.jackrabbit.oak.kernel.KernelNodeStore;
 import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.apache.jackrabbit.oak.upgrade.RepositoryUpgrade;
 import org.junit.Test;
 
 public class RepositoryUpgradeTest {
@@ -73,17 +73,18 @@ public class RepositoryUpgradeTest {
         File directory = new File("target", "upgrade");
         FileUtils.deleteQuietly(directory);
 
-        RepositoryConfig config = RepositoryConfig.install(directory);
-        RepositoryImpl source = RepositoryImpl.create(config);
+        File source = new File(directory, "source");
+        RepositoryConfig config = RepositoryConfig.install(source);
+        RepositoryImpl repository = RepositoryImpl.create(config);
         try {
-            createSourceContent(source);
+            createSourceContent(repository);
         } finally {
-            source.shutdown();
+            repository.shutdown();
         }
 
-        NodeStore store = new KernelNodeStore(new MicroKernelImpl());
-        RepositoryUpgrade.copy(directory, store);
-        Jcr jcr = new Jcr(new Oak(store));
+        NodeStore target = new KernelNodeStore(new MicroKernelImpl());
+        RepositoryUpgrade.copy(source, target);
+        Jcr jcr = new Jcr(new Oak(target));
         verifyTargetContent(jcr.createRepository());
     }
 

Propchange: jackrabbit/oak/trunk/oak-upgrade/src/test/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgradeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/oak/trunk/oak-upgrade/src/test/resources/logback-test.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/test/resources/logback-test.xml?rev=1478772&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-upgrade/src/test/resources/logback-test.xml (added)
+++ jackrabbit/oak/trunk/oak-upgrade/src/test/resources/logback-test.xml Fri May  3 13:19:11
2013
@@ -0,0 +1,39 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+  -->
+<configuration>
+
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%date{HH:mm:ss.SSS} %-5level %-40([%thread] %F:%L) %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="file" class="ch.qos.logback.core.FileAppender">
+        <file>target/unit-tests.log</file>
+        <encoder>
+            <pattern>%date{HH:mm:ss.SSS} %-5level %-40([%thread] %F:%L) %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <root level="DEBUG">
+        <!--
+        <appender-ref ref="console"/>
+        -->
+        <appender-ref ref="file"/>
+    </root>
+
+</configuration>

Propchange: jackrabbit/oak/trunk/oak-upgrade/src/test/resources/logback-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/pom.xml?rev=1478772&r1=1478771&r2=1478772&view=diff
==============================================================================
--- jackrabbit/oak/trunk/pom.xml (original)
+++ jackrabbit/oak/trunk/pom.xml Fri May  3 13:19:11 2013
@@ -44,6 +44,7 @@
     <module>oak-mongomk</module>
     <module>oak-core</module>
     <module>oak-jcr</module>
+    <module>oak-upgrade</module>
     <module>oak-sling</module>
     <module>oak-http</module>
     <module>oak-lucene</module>



Mime
View raw message