activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1444553 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
Date Sun, 10 Feb 2013 15:04:25 GMT
Author: chirino
Date: Sun Feb 10 15:04:25 2013
New Revision: 1444553

URL: http://svn.apache.org/r1444553
Log:
Add some pending store debug info to the log status of the leveldb store.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala?rev=1444553&r1=1444552&r2=1444553&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
Sun Feb 10 15:04:25 2013
@@ -27,6 +27,7 @@ import org.apache.activemq.apollo.dto.{S
 import org.fusesource.hawtbuf.Buffer
 import java.lang.ref.WeakReference
 import language.implicitConversions
+import java.io.{PrintWriter, StringWriter}
 
 object DelayingStoreSupport extends Log
 
@@ -347,12 +348,20 @@ trait DelayingStoreSupport extends Store
     rc.flushed_message_counter = metric_flushed_message_counter
     rc.flushed_enqueue_counter = metric_flushed_enqueue_counter
     rc.pending_stores = pending_stores.size
+  }
+
+  def detailed_pending_status = {
+    import collection.JavaConversions._
 
-//    import collection.JavaConversions._
-//    println("--------------")
-//    pending_stores.valuesIterator.foreach{ action =>
-//      println(action.uow.state+": "+action.uow.uow_id+" "+action.uow.delayable)
-//    }
+    val writer = new StringWriter();
+    val out = new PrintWriter(writer);
+
+    out.println("--- Pending Stores Details ---")
+    out.println("flush_source suspended: "+flush_source.isSuspended)
+    pending_stores.valuesIterator.foreach{ action =>
+      out.println("uow: %d, state:%s, delayable:%s, canceled:%s".format(action.uow.uow_id,
action.uow.state, action.uow.delayable, action.uow.canceled))
+    }
+    writer.toString
   }
 
   def key(x:QueueEntryRecord) = (x.queue_key, x.entry_seq)

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala?rev=1444553&r1=1444552&r2=1444553&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
Sun Feb 10 15:04:25 2013
@@ -283,6 +283,8 @@ class LevelDBStore(val config: LevelDBSt
       }
     }
     rc.message_load_batch_size = message_load_batch_size
+    import collection.JavaConversions._
+    val pending_status = detailed_pending_status
     write_executor {
       client.using_index {
         rc.index_stats = client.index.getProperty("leveldb.stats")
@@ -311,6 +313,7 @@ class LevelDBStore(val config: LevelDBSt
             }.mkString("")
         }
       }
+      rc.log_stats += pending_status
       callback(rc)
     }
   }



Mime
View raw message