jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chet...@apache.org
Subject svn commit: r1592658 - in /jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade: JackrabbitNodeState.java RepositoryUpgrade.java
Date Tue, 06 May 2014 05:11:49 GMT
Author: chetanm
Date: Tue May  6 05:11:49 2014
New Revision: 1592658

URL: http://svn.apache.org/r1592658
Log:
OAK-1795 - RepositoryUpgrade fails for very long path with DocumentNodeStore

Applying patch from Marcel which skips path having long names

Modified:
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
    jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java

Modified: jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java?rev=1592658&r1=1592657&r2=1592658&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/JackrabbitNodeState.java
Tue May  6 05:11:49 2014
@@ -162,6 +162,11 @@ class JackrabbitNodeState extends Abstra
         logNewNode(this);
     }
 
+    @Override
+    public String toString() {
+        return getPath();
+    }
+
     //---------------------------------------------------------< NodeState >--
 
     @Override

Modified: jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java?rev=1592658&r1=1592657&r2=1592658&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java
(original)
+++ jackrabbit/oak/trunk/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositoryUpgrade.java
Tue May  6 05:11:49 2014
@@ -90,6 +90,7 @@ import javax.jcr.UnsupportedRepositoryOp
 import javax.jcr.security.Privilege;
 import javax.jcr.version.OnParentVersionAction;
 
+import com.google.common.base.Charsets;
 import com.google.common.collect.HashBiMap;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -779,6 +780,12 @@ public class RepositoryUpgrade {
      * This is a temporary approach for OAK-1760 for 1.0 branch.
      */
     private void setChildNode(NodeBuilder parent, String name, NodeState state) {
+        // OAK-1589: maximum supported length of name for DocumentNodeStore
+        // is 150 bytes. Skip the sub tree if the the name is too long
+        if (name.length() > 37 && name.getBytes(Charsets.UTF_8).length > 150)
{
+            logger.warn("Node name too long. Skipping {}", state);
+            return;
+        }
         NodeBuilder builder = parent.setChildNode(name);
         for (PropertyState property : state.getProperties()) {
             builder.setProperty(property);



Mime
View raw message