jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1547724 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java
Date Wed, 04 Dec 2013 08:01:00 GMT
Author: thomasm
Date: Wed Dec  4 08:01:00 2013
New Revision: 1547724

URL: http://svn.apache.org/r1547724
Log:
OAK-98 Helper method for human visible output

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java?rev=1547724&r1=1547723&r2=1547724&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/Revision.java
Wed Dec  4 08:01:00 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.oak.plugins.mongomk;
 
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
@@ -165,6 +166,22 @@ public class Revision {
                 Integer.toHexString(counter) + '-' + Integer.toHexString(clusterId);
     }
     
+    public String toReadableString() {
+        StringBuilder buff = new StringBuilder();
+        buff.append("revision: \"").append(toString()).append("\"");
+        buff.append(", clusterId: ").append(clusterId);
+        buff.append(", time: \"").
+            append((new Timestamp(timestamp) + "00").substring(0, 23)).
+            append("\"");
+        if (counter > 0) {
+            buff.append(", counter: ").append(counter);
+        }
+        if (branch) {
+            buff.append(", branch: true");
+        }
+        return buff.toString();
+    }
+    
     /**
      * Get the timestamp in milliseconds since 1970.
      * 



Mime
View raw message