jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1491398 - in /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk: MongoDocumentStore.java Revision.java
Date Mon, 10 Jun 2013 10:27:15 GMT
Author: thomasm
Date: Mon Jun 10 10:27:14 2013
New Revision: 1491398

URL: http://svn.apache.org/r1491398
Log:
OAK-857 MongoMK: support for many child nodes (logging, reduced memory usage)

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoDocumentStore.java
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Revision.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoDocumentStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoDocumentStore.java?rev=1491398&r1=1491397&r2=1491398&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoDocumentStore.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/MongoDocumentStore.java
Mon Jun 10 10:27:14 2013
@@ -96,9 +96,13 @@ public class MongoDocumentStore implemen
         return LOG_TIME ? System.currentTimeMillis() : 0;
     }
     
-    private void end(long start) {
+    private void end(String message, long start) {
         if (LOG_TIME) {
-            timeSum += System.currentTimeMillis() - start;
+            long t = System.currentTimeMillis() - start;
+            if (t > 0) {
+                LOG.debug(message + ": " + t);
+            }
+            timeSum += t;
         }
     }
     
@@ -170,7 +174,7 @@ public class MongoDocumentStore implemen
             }
             return convertFromDBObject(doc);
         } finally {
-            end(start);
+            end("findUncached", start);
         }
     }
     
@@ -209,7 +213,7 @@ public class MongoDocumentStore implemen
             }
             return list;
         } finally {
-            end(start);
+            end("query", start);
         }
     }
 
@@ -227,7 +231,7 @@ public class MongoDocumentStore implemen
                 throw new MicroKernelException("Remove failed: " + writeResult.getError());
             }
         } finally {
-            end(start);
+            end("remove", start);
         }
     }
 
@@ -321,7 +325,7 @@ public class MongoDocumentStore implemen
         } catch (Exception e) {
             throw new MicroKernelException(e);
         } finally {
-            end(start);
+            end("findAndModify", start);
         }
     }
 
@@ -403,7 +407,7 @@ public class MongoDocumentStore implemen
                 return false;
             }
         } finally {
-            end(start);
+            end("create", start);
         }        
     }
 

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Revision.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Revision.java?rev=1491398&r1=1491397&r2=1491398&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Revision.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/Revision.java
Mon Jun 10 10:27:14 2013
@@ -52,6 +52,11 @@ public class Revision {
      */
     private int clusterId;
     
+    /**
+     * The string representation.
+     */
+    private String string;
+    
     public Revision(long timestamp, int counter, int clusterId) {
         this.timestamp = timestamp;
         this.counter = counter;
@@ -146,13 +151,16 @@ public class Revision {
     
     @Override
     public String toString() {
-        return new StringBuilder("r").
+        if (string == null) {
+            string = new StringBuilder("r").
                 append(Long.toHexString(timestamp)).
                 append('-').
                 append(Integer.toHexString(counter)).
                 append('-').
                 append(Integer.toHexString(clusterId)).
                 toString();
+        }
+        return string;
     }
     
     public long getTimestamp() {



Mime
View raw message