activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r829054 - in /activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page: HawtPageFile.java HawtTransaction.java
Date Fri, 23 Oct 2009 13:27:08 GMT
Author: chirino
Date: Fri Oct 23 13:27:07 2009
New Revision: 829054

URL: http://svn.apache.org/viewvc?rev=829054&view=rev
Log:
Enhanced toStrings to assist in debugging

Modified:
    activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtPageFile.java
    activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtTransaction.java

Modified: activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtPageFile.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtPageFile.java?rev=829054&r1=829053&r2=829054&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtPageFile.java
(original)
+++ activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtPageFile.java
Fri Oct 23 13:27:07 2009
@@ -635,6 +635,41 @@
         ByteBuffer slice = file.slice(false, 0, FILE_HEADER_SIZE);
         this.header.setByteBuffer(slice, slice.position());
     }
+    
+    @Override
+    public String toString() {
+        return "{ allocator: "+allocator
+        +", synch: "+synch
+        +", read cache size: "+readCache.map.size()
+        +", base revision free pages: "+baseRevisionFreePages + ",\n"
+        + "  redos: {\n" 
+        + "    performed: "+toString(performedRedos, syncedRedos) + ",\n" 
+        + "    synced: "+toString(syncedRedos, storedRedos) + ",\n" 
+        + "    stored: "+toString(storedRedos, buildingRedo)+ ",\n" 
+        + "    building: "+toString(buildingRedo, null)+ ",\n"
+        + "  }"        
+        + "}";
+    }
+
+    /** 
+     * @param from
+     * @param to
+     * @return string representation of the redo items from the specified redo up to (exclusive)
the specified redo.
+     */
+    private String toString(Redo from, Redo to) {
+        StringBuilder rc = new StringBuilder();
+        rc.append("[ ");
+        Redo t = from;
+        while( t!=null && t!=to ) {
+            if( t!=from ) {
+                rc.append(", ");
+            }
+            rc.append(t);
+            t = t.getNext();
+        }
+        rc.append(" ]");
+        return rc.toString();
+    }
 
     public Transaction tx() {
         return new HawtTransaction(this);

Modified: activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtTransaction.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtTransaction.java?rev=829054&r1=829053&r2=829054&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtTransaction.java
(original)
+++ activemq/sandbox/activemq-apollo/hawtdb/src/main/java/org/apache/hawtdb/internal/page/HawtTransaction.java
Fri Oct 23 13:27:07 2009
@@ -282,7 +282,7 @@
 
     public String toString() { 
         int updatesSize = updates==null ? 0 : updates.size();
-        return "{ snapshot: "+this.snapshot+", updates: "+updatesSize+" }";
+        return "{ snapshot: "+this.snapshot+", updates: "+updatesSize+", parent: "+parent+"
}";
     }
 
     public int pages(int length) {



Mime
View raw message