Skip to content

Instantly share code, notes, and snippets.

@rombert
Created June 1, 2016 13:21
Show Gist options
  • Save rombert/3bcd736268ce0d85df1ee8842b7ca7be to your computer and use it in GitHub Desktop.
Save rombert/3bcd736268ce0d85df1ee8842b7ca7be to your computer and use it in GitHub Desktop.
Oak multiplexing

Instructions for setting up Oak with multiplexing

These assume that you are familiar with Oak and Sling.

  1. (Oak) Checkout and build the features/docstore-multiplex branch of https://github.com/rombert/jackrabbit-oak/
  2. (Sling) Configure Sling to use a multiplexed mount by default
diff --git a/bundles/jcr/oak-server/pom.xml b/bundles/jcr/oak-server/pom.xml
index 28e752f..b86e898 100644
--- a/bundles/jcr/oak-server/pom.xml
+++ b/bundles/jcr/oak-server/pom.xml
@@ -47,7 +47,7 @@
             WARNING make sure oak.version and sling.oak.server.version 
             are in sync with bundles/jcr/it-jackrabbit-oak
         -->
-        <oak.version>1.4.0</oak.version>
+        <oak.version>1.6-SNAPSHOT</oak.version>
     </properties>
 
     <build>
diff --git a/bundles/jcr/oak-server/src/main/java/org/apache/sling/oak/server/OakSlingRepositoryManager.java b/bundles/jcr/oak-server/src/main/java/org/apache/sling/oak/server/OakSlingRepositoryManager.java
index 3eac792..c4d3258 100644
--- a/bundles/jcr/oak-server/src/main/java/org/apache/sling/oak/server/OakSlingRepositoryManager.java
+++ b/bundles/jcr/oak-server/src/main/java/org/apache/sling/oak/server/OakSlingRepositoryManager.java
@@ -55,7 +55,7 @@ import org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider;
 import org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider;
 import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
 import org.apache.jackrabbit.oak.plugins.observation.CommitRateLimiter;
-import org.apache.jackrabbit.oak.plugins.version.VersionEditorProvider;
+import org.apache.jackrabbit.oak.plugins.version.VersionHook;
 import org.apache.jackrabbit.oak.spi.commit.EditorHook;
 import org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer;
 import org.apache.jackrabbit.oak.spi.security.SecurityProvider;
@@ -214,7 +214,7 @@ public class OakSlingRepositoryManager extends AbstractSlingRepositoryManager {
         .with(new ExtraSlingContent())
 
         .with(JcrConflictHandler.createJcrConflictHandler())
-        .with(new EditorHook(new VersionEditorProvider()))
+        .with(new VersionHook())
 
         .with(securityProvider)
 
diff --git a/launchpad/builder/src/main/provisioning/oak.txt b/launchpad/builder/src/main/provisioning/oak.txt
index 31627b7..49b03b4 100644
--- a/launchpad/builder/src/main/provisioning/oak.txt
+++ b/launchpad/builder/src/main/provisioning/oak.txt
@@ -20,7 +20,7 @@
 [feature name=oak]
 
 [variables]
-    oak.version=1.4.0
+    oak.version=1.6-SNAPSHOT
 
 # The segment node store is used via a configuration
 [artifacts startLevel=10]
@@ -87,4 +87,8 @@
 [configurations runModes=oak_mongo]
   org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService
     mongouri="mongodb://localhost:27017"
-    db="sling"
+    db="sling_0dt"
+    mounts=["/libs:private","/apps:private"]
+
+  org.apache.jackrabbit.oak.plugins.multiplex.MountInfoProviderService
+	mountedPaths=["/libs", "/apps"]
\ No newline at end of file
  1. (Sling) Build and install bundles/jcr/oak-server
  2. (Sling) Build launchpad/builder
  3. (Sling) Launch Sling with the oak_mongo run mode: java -jar target/org.apache.sling.launchpad-9-SNAPSHOT.jar -Dsling.run.modes=oak_mongo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment