You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2015/03/23 16:34:58 UTC

svn commit: r1668669 - in /jackrabbit/oak/branches/1.0: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/ oak-core/src/main/java/org/apache/jackrabbit/oa...

Author: reschke
Date: Mon Mar 23 15:34:57 2015
New Revision: 1668669

URL: http://svn.apache.org/r1668669
Log:
fix svn:eol-style

Modified:
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/CacheMap.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/MapFactory.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/RecordIdSet.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentVersion.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStoreGCMonitor.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/GCMonitorMBean.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ErrorValue.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/gc/GCMonitor.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/gc/GCMonitorTracker.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/gc/package-info.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/stats/TimeSeriesStatsUtil.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentVersionTest.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/ShortSetTest.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/file/LargeNumberOfPropertiesTestIT.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RefreshOnGCTest.java   (props changed)
    jackrabbit/oak/branches/1.0/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositorySidegrade.java   (contents, props changed)

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/CacheMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/persistentCache/MapFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/RecordIdSet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/SegmentVersion.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStoreGCMonitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/GCMonitorMBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ErrorValue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/gc/GCMonitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/gc/GCMonitorTracker.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/gc/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/main/java/org/apache/jackrabbit/oak/stats/TimeSeriesStatsUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentVersionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/ShortSetTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/file/LargeNumberOfPropertiesTestIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/oak/branches/1.0/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RefreshOnGCTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/branches/1.0/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositorySidegrade.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.0/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositorySidegrade.java?rev=1668669&r1=1668668&r2=1668669&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.0/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositorySidegrade.java (original)
+++ jackrabbit/oak/branches/1.0/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositorySidegrade.java Mon Mar 23 15:34:57 2015
@@ -1,153 +1,153 @@
-/*
- * 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.
- */
-package org.apache.jackrabbit.oak.upgrade;
-
-import java.io.File;
-import javax.jcr.RepositoryException;
-
-import com.google.common.base.Charsets;
-import org.apache.jackrabbit.oak.api.CommitFailedException;
-import org.apache.jackrabbit.oak.api.PropertyState;
-import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
-import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeBuilder;
-import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
-import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
-import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
-import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
-import org.apache.jackrabbit.oak.spi.state.NodeState;
-import org.apache.jackrabbit.oak.spi.state.NodeStore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RepositorySidegrade {
-
-    /**
-     * Logger instance
-     */
-    private static final Logger logger =
-        LoggerFactory.getLogger(RepositorySidegrade.class);
-
-    /**
-     * Target node store.
-     */
-    private final NodeStore target;
-
-    private final NodeStore source;
-
-    private boolean copyBinariesByReference = false;
-
-    /**
-     * 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.
-     *
-     * @param source source node store
-     * @param target target node store
-     */
-    public RepositorySidegrade(NodeStore source, NodeStore target) {
-        this.source = source;
-        this.target = target;
-    }
-
-    public boolean isCopyBinariesByReference() {
-        return copyBinariesByReference;
-    }
-
-    public void setCopyBinariesByReference(boolean copyBinariesByReference) {
-        this.copyBinariesByReference = copyBinariesByReference;
-    }
-
-    /**
-     * Copies the full content from the source to the target repository.
-     * <p>
-     * The source repository <strong>must not be modified</strong> while
-     * the copy operation is running to avoid an inconsistent copy.
-     * <p>
-     * Note that both the source and the target repository must be closed
-     * during the copy operation as this method requires exclusive access
-     * to the repositories.
-     *
-     * @param source source node store
-     * @param target target node store
-     * @throws RepositoryException if the copy operation fails
-     */
-    public static void copy(NodeStore source, NodeStore target)
-            throws RepositoryException {
-        new RepositorySidegrade(source, target).copy();
-    }
-    /**
-     * Copies the full content from the source to the target repository.
-     * <p>
-     * The source repository <strong>must not be modified</strong> while
-     * the copy operation is running to avoid an inconsistent copy.
-     * <p>
-     * Note that both the source and the target repository must be closed
-     * during the copy operation as this method requires exclusive access
-     * to the repositories.
-     *
-     * @throws RepositoryException if the copy operation fails
-     */
-    public void copy() throws RepositoryException {
-        try {
-            NodeState root = source.getRoot();
-            NodeBuilder builder = target.getRoot().builder();
-
-            new InitialContent().initialize(builder);
-
-            copyState(builder, root);
-
-            target.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
-        } catch (Exception e) {
-            throw new RepositoryException("Failed to copy content", e);
-        }
-    }
-
-    private void copyState(NodeBuilder parent, NodeState state) throws CommitFailedException {
-        boolean isSegmentNodeBuilder = parent instanceof SegmentNodeBuilder;
-        for (PropertyState property : state.getProperties()) {
-            parent.setProperty(property);
-        }
-        for (ChildNodeEntry entry : state.getChildNodeEntries()) {
-            if (isSegmentNodeBuilder) {
-                parent.setChildNode(entry.getName(), entry.getNodeState());
-            } else {
-                setChildNode(parent, entry.getName(), entry.getNodeState());
-            }
-        }
-        target.merge(parent, EmptyHook.INSTANCE, CommitInfo.EMPTY);
-    }
-
-    /**
-     * NodeState are copied by value by recursing down the complete tree
-     * 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);
-        }
-        for (ChildNodeEntry child : state.getChildNodeEntries()) {
-            setChildNode(builder, child.getName(), child.getNodeState());
-        }
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.jackrabbit.oak.upgrade;
+
+import java.io.File;
+import javax.jcr.RepositoryException;
+
+import com.google.common.base.Charsets;
+import org.apache.jackrabbit.oak.api.CommitFailedException;
+import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent;
+import org.apache.jackrabbit.oak.plugins.segment.SegmentNodeBuilder;
+import org.apache.jackrabbit.oak.spi.commit.CommitInfo;
+import org.apache.jackrabbit.oak.spi.commit.EmptyHook;
+import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
+import org.apache.jackrabbit.oak.spi.state.NodeState;
+import org.apache.jackrabbit.oak.spi.state.NodeStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RepositorySidegrade {
+
+    /**
+     * Logger instance
+     */
+    private static final Logger logger =
+        LoggerFactory.getLogger(RepositorySidegrade.class);
+
+    /**
+     * Target node store.
+     */
+    private final NodeStore target;
+
+    private final NodeStore source;
+
+    private boolean copyBinariesByReference = false;
+
+    /**
+     * 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.
+     *
+     * @param source source node store
+     * @param target target node store
+     */
+    public RepositorySidegrade(NodeStore source, NodeStore target) {
+        this.source = source;
+        this.target = target;
+    }
+
+    public boolean isCopyBinariesByReference() {
+        return copyBinariesByReference;
+    }
+
+    public void setCopyBinariesByReference(boolean copyBinariesByReference) {
+        this.copyBinariesByReference = copyBinariesByReference;
+    }
+
+    /**
+     * Copies the full content from the source to the target repository.
+     * <p>
+     * The source repository <strong>must not be modified</strong> while
+     * the copy operation is running to avoid an inconsistent copy.
+     * <p>
+     * Note that both the source and the target repository must be closed
+     * during the copy operation as this method requires exclusive access
+     * to the repositories.
+     *
+     * @param source source node store
+     * @param target target node store
+     * @throws RepositoryException if the copy operation fails
+     */
+    public static void copy(NodeStore source, NodeStore target)
+            throws RepositoryException {
+        new RepositorySidegrade(source, target).copy();
+    }
+    /**
+     * Copies the full content from the source to the target repository.
+     * <p>
+     * The source repository <strong>must not be modified</strong> while
+     * the copy operation is running to avoid an inconsistent copy.
+     * <p>
+     * Note that both the source and the target repository must be closed
+     * during the copy operation as this method requires exclusive access
+     * to the repositories.
+     *
+     * @throws RepositoryException if the copy operation fails
+     */
+    public void copy() throws RepositoryException {
+        try {
+            NodeState root = source.getRoot();
+            NodeBuilder builder = target.getRoot().builder();
+
+            new InitialContent().initialize(builder);
+
+            copyState(builder, root);
+
+            target.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+        } catch (Exception e) {
+            throw new RepositoryException("Failed to copy content", e);
+        }
+    }
+
+    private void copyState(NodeBuilder parent, NodeState state) throws CommitFailedException {
+        boolean isSegmentNodeBuilder = parent instanceof SegmentNodeBuilder;
+        for (PropertyState property : state.getProperties()) {
+            parent.setProperty(property);
+        }
+        for (ChildNodeEntry entry : state.getChildNodeEntries()) {
+            if (isSegmentNodeBuilder) {
+                parent.setChildNode(entry.getName(), entry.getNodeState());
+            } else {
+                setChildNode(parent, entry.getName(), entry.getNodeState());
+            }
+        }
+        target.merge(parent, EmptyHook.INSTANCE, CommitInfo.EMPTY);
+    }
+
+    /**
+     * NodeState are copied by value by recursing down the complete tree
+     * 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);
+        }
+        for (ChildNodeEntry child : state.getChildNodeEntries()) {
+            setChildNode(builder, child.getName(), child.getNodeState());
+        }
+    }
+}

Propchange: jackrabbit/oak/branches/1.0/oak-upgrade/src/main/java/org/apache/jackrabbit/oak/upgrade/RepositorySidegrade.java
------------------------------------------------------------------------------
    svn:eol-style = native