jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1521485 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/Utils.java test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java
Date Tue, 10 Sep 2013 13:51:42 GMT
Author: mreutegg
Date: Tue Sep 10 13:51:41 2013
New Revision: 1521485

URL: http://svn.apache.org/r1521485
Log:
OAK-926: MongoMK: split documents when they are too large

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/Utils.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/Utils.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/Utils.java?rev=1521485&r1=1521484&r2=1521485&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/Utils.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/util/Utils.java
Tue Sep 10 13:51:41 2013
@@ -16,10 +16,12 @@
  */
 package org.apache.jackrabbit.oak.plugins.mongomk.util;
 
+import java.util.Comparator;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.SortedMap;
 import java.util.TreeMap;
 
 import javax.annotation.Nonnull;
@@ -194,10 +196,16 @@ public class Utils {
     public static <K> void deepCopyMap(Map<K, Object> source, Map<K, Object>
target) {
         for (Entry<K, Object> e : source.entrySet()) {
             Object value = e.getValue();
+            Comparator<? super K> comparator = null;
+            if (value instanceof SortedMap) {
+                @SuppressWarnings("unchecked")
+                SortedMap<K, Object> map = (SortedMap<K, Object>) value;
+                comparator = map.comparator();
+            }
             if (value instanceof Map<?, ?>) {
                 @SuppressWarnings("unchecked")
-                Map<Object, Object> old = (Map<Object, Object>) value;
-                Map<Object, Object> c = newMap();
+                Map<K, Object> old = (Map<K, Object>) value;
+                Map<K, Object> c = new TreeMap<K, Object>(comparator);
                 deepCopyMap(old, c);
                 value = c;
             }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java?rev=1521485&r1=1521484&r2=1521485&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/mongomk/DocumentSplitTest.java
Tue Sep 10 13:51:41 2013
@@ -34,7 +34,6 @@ import static org.junit.Assert.assertTru
  */
 public class DocumentSplitTest extends BaseMongoMKTest {
 
-    @Ignore
     @Test
     public void splitRevisions() throws Exception {
         DocumentStore store = mk.getDocumentStore();



Mime
View raw message