You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2013/02/09 17:35:30 UTC

svn commit: r1444391 - in /activemq/activemq-apollo/trunk: apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/ apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/ apollo-broker/src/main/scala/org/apach...

Author: chirino
Date: Sat Feb  9 16:35:30 2013
New Revision: 1444391

URL: http://svn.apache.org/r1444391
Log:
Updated console to display bdb store details.

Modified:
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala
    activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/DelayingStoreSupport.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/scala/org/apache/activemq/apollo/broker/store/leveldb/LevelDBStore.scala
    activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala?rev=1444391&r1=1444390&r2=1444391&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/scala/org/apache/activemq/apollo/broker/store/bdb/BDBStore.scala Sat Feb  9 16:35:30 2013
@@ -222,6 +222,9 @@ class BDBStore(var config:BDBStoreDTO) e
     dispatch_queue.executeAfter(1, TimeUnit.SECONDS, ^{ displayStats })
   }
 
+  def kind = "BDB"
+  def location = config.directory.toString
+
   def get_store_status(callback:(StoreStatusDTO)=>Unit) = dispatch_queue {
     val rc = new BDBStoreStatusDTO
     fill_store_status(rc)

Modified: activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade?rev=1444391&r1=1444390&r2=1444391&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade (original)
+++ activemq/activemq-apollo/trunk/apollo-bdb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/bdb/dto/BDBStoreStatusDTO.jade Sat Feb  9 16:35:30 2013
@@ -22,7 +22,7 @@
 .breadcumbs
   a(href={strip_resolve(".")}) Back
 
-h1 Store: #{id}
+h1 #{kind} Store at: #{location}
 p state: #{state} for #{ uptime(state_since) }
 
 p pending stores: #{pending_stores}

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=1444391&r1=1444390&r2=1444391&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 Sat Feb  9 16:35:30 2013
@@ -334,7 +334,8 @@ trait DelayingStoreSupport extends Store
   var canceled_enqueue:Long = 0
 
   protected def fill_store_status(rc: StoreStatusDTO) {
-    rc.id = this.toString
+    rc.kind = this.kind
+    rc.location = this.location
     rc.state = service_state.toString
     rc.state_since = service_state.since
 

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala?rev=1444391&r1=1444390&r2=1444391&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/store/Store.scala Sat Feb  9 16:35:30 2013
@@ -113,6 +113,10 @@ case class ImportStreamManager(source:In
  */
 trait Store extends ServiceTrait {
 
+  def kind:String
+
+  def location:String
+
   def get_store_status(callback:(StoreStatusDTO)=>Unit)
 
   /**

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java?rev=1444391&r1=1444390&r2=1444391&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/StoreStatusDTO.java Sat Feb  9 16:35:30 2013
@@ -32,7 +32,7 @@ import javax.xml.bind.annotation.XmlType
 @JsonTypeInfo(use=JsonTypeInfo.Id.CUSTOM, include=JsonTypeInfo.As.PROPERTY, property="@class")
 @JsonTypeIdResolver(ApolloTypeIdResolver.class)
 @JsonIgnoreProperties(ignoreUnknown = true)
-public abstract class StoreStatusDTO extends StringIdDTO {
+public abstract class StoreStatusDTO {
 
     /**
      * The state of the service.
@@ -41,6 +41,18 @@ public abstract class StoreStatusDTO ext
 	public String state;
 
     /**
+     * The kind of store it is.
+     */
+	@XmlAttribute(name="kind")
+	public String kind;
+
+    /**
+     * The kind of store it is.
+     */
+	@XmlAttribute(name="location")
+	public String location;
+
+    /**
      * The amount of disk space the store is using.
      */
 	@XmlAttribute(name="disk_usage")

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=1444391&r1=1444390&r2=1444391&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 Sat Feb  9 16:35:30 2013
@@ -271,6 +271,9 @@ class LevelDBStore(val config: LevelDBSt
     message_load_batch_size = message_load_batch_size_counter(true)
   }
 
+  def kind = "LevelDB"
+  def location = config.directory.toString
+
   def get_store_status(callback: (StoreStatusDTO) => Unit) = dispatch_queue {
     val rc = new LevelDBStoreStatusDTO
     fill_store_status(rc)

Modified: activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade?rev=1444391&r1=1444390&r2=1444391&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade (original)
+++ activemq/activemq-apollo/trunk/apollo-leveldb/src/main/webapp/WEB-INF/org/apache/activemq/apollo/broker/store/leveldb/dto/LevelDBStoreStatusDTO.jade Sat Feb  9 16:35:30 2013
@@ -24,7 +24,7 @@
 .breadcumbs
   a(href={strip_resolve(".")}) Back
 
-h1 Store: #{id}
+h1 #{kind} Store at: #{location}
 p state: #{state} for #{ uptime(state_since) }
 
 p pending stores: #{pending_stores}

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html?rev=1444391&r1=1444390&r2=1444391&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/index.html Sat Feb  9 16:35:30 2013
@@ -137,11 +137,10 @@
             </div>
             {{#if App.virtual_host.store}}
             <div class="well" style="padding: 8px 8px">
-              {{#if App.VirtualHostController.store_is_leveldb}}
-              <div class="well-title">LevelDB Store Status</div>
+              <div class="well-title">{{App.virtual_host_store.kind}} Store Status</div>
               <table class="details table table-bordered table-striped">
                 <tbody>
-                <tr><td><strong>Location: </strong>{{App.virtual_host_store.id}}</td></tr>
+                <tr><td><strong>Location: </strong>{{App.virtual_host_store.location}}</td></tr>
                 <tr><td><strong>Disk Usage: </strong>{{memory App.virtual_host_store.disk_usage}}</td></tr>
                 <tr><td><strong>Messages Stored:</strong>
                   <table class="details table table-bordered table-striped">
@@ -160,14 +159,24 @@
                     </tbody>
                   </table>
                 </td></tr>
+
+                {{#if App.virtual_host_store.index_snapshot_pos}}
                 <tr><td><strong>Index snapshot at: </strong>{{hex App.virtual_host_store.index_snapshot_pos}}</td></tr>
+                {{/if}}
+                {{#if App.virtual_host_store.log_append_pos}}
                 <tr><td><strong>Log append position: </strong>{{hex App.virtual_host_store.log_append_pos}}</td></tr>
+                {{/if}}
+                {{#if App.virtual_host_store.log_stats}}
                 <tr><td style="max-width:100px"><strong>Log Details: </strong>
                     <pre style="color:#333; font-size:80%; overflow:auto; word-wrap: normal; white-space:pre;">{{App.virtual_host_store.log_stats}}</pre>
                 </td></tr>
+                {{/if}}
+                {{#if App.virtual_host_store.index_stats}}
                 <tr><td style="max-width:100px"><strong>Index Details: </strong>
                   <pre style="color:#333; font-size:80%; overflow:auto; word-wrap: normal; white-space:pre;">{{App.virtual_host_store.index_stats}}</pre>
                 </td></tr>
+                {{/if}}
+
                 <tr><td><strong>Message Load Latency: </strong>
                   <table class="details table table-bordered table-striped">
                     <tbody>
@@ -190,14 +199,6 @@
                 </td></tr>
                 </tbody>
               </table>
-              {{else}}
-              <div class="well-title">Store</div>
-              <table class="details table table-bordered table-striped">
-                <tbody>
-                <tr><td><strong>Name: </strong>{{App.virtual_host_store.id}}</td></tr>
-                </tbody>
-              </table>
-              {{/if}}
             </div>
             {{/if}}
           </div>

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js?rev=1444391&r1=1444390&r2=1444391&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/console/js/app.js Sat Feb  9 16:35:30 2013
@@ -357,6 +357,7 @@ App.ConnectionsController = App.PagedArr
 });
 
 App.virtual_host = Ember.Object.create({});
+
 App.virtual_host_store = Ember.Object.create({});
 App.VirtualHostController = Em.ArrayController.create({
   tabs:["Queues","Topics","Durable Subs"],
@@ -392,7 +393,11 @@ App.VirtualHostController = Em.ArrayCont
         App.virtual_host.setProperties(host);
         if( host.store ) {
           App.ajax("GET", "/broker/virtual-hosts/"+selected+"/store", function(store) {
-            App.virtual_host_store.setProperties(store);
+            if( App.virtual_host_store.get("kind") == store.kind) {
+              App.virtual_host_store.setProperties(store);
+            } else {
+              App.set("virtual_host_store", Ember.Object.create(store));
+            }
           });
         } 
       });
@@ -410,6 +415,11 @@ App.VirtualHostController = Em.ArrayCont
    var clazz = App.get("virtual_host_store.@class")
    return clazz == "leveldb_store_status";
   }.property("App.virtual_host_store.@class"),
+
+  store_is_bdb: function(){
+   var clazz = App.get("virtual_host_store.@class")
+   return clazz == "bdb_store_status";
+  }.property("App.virtual_host_store.@class"),
 });
 
 App.DestinationsController = App.PagedArrayController.create({