rhmessaging commits: r2112 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-02 21:07:24 -0400 (Mon, 02 Jun 2008)
New Revision: 2112
Modified:
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/queue.py
Log:
Some more corrections for the schema update
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-06-03 00:45:18 UTC (rev 2111)
+++ mgmt/cumin/python/cumin/exchange.py 2008-06-03 01:07:24 UTC (rev 2112)
@@ -371,7 +371,7 @@
self.add_child(chart)
chart = StatValueChart(app, "producers")
- chart.stats = ("producers",)
+ chart.stats = ("producerCount",)
self.add_child(chart)
def render_title(self, session):
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-06-03 00:45:18 UTC (rev 2111)
+++ mgmt/cumin/python/cumin/model.py 2008-06-03 01:07:24 UTC (rev 2112)
@@ -555,12 +555,12 @@
prop = CuminProperty(self, "exclusive")
prop.title = "Exclusive?"
- stat = CuminStat(self, "consumers")
+ stat = CuminStat(self, "consumerCount")
stat.title = "Consumers"
stat.unit = "consumer"
stat.highlow = True
- stat = CuminStat(self, "bindings")
+ stat = CuminStat(self, "bindingCount")
stat.title = "Bindings"
stat.unit = "binding"
stat.highlow = True
@@ -738,12 +738,12 @@
prop.title = "Type"
prop.summary = True
- stat = CuminStat(self, "producers")
+ stat = CuminStat(self, "producerCount")
stat.title = "Producers"
stat.unit = "producer"
stat.highlow = True
- stat = CuminStat(self, "bindings")
+ stat = CuminStat(self, "bindingCount")
stat.title = "Bindings"
stat.unit = "binding"
stat.highlow = True
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2008-06-03 00:45:18 UTC (rev 2111)
+++ mgmt/cumin/python/cumin/queue.py 2008-06-03 01:07:24 UTC (rev 2112)
@@ -216,7 +216,8 @@
return self.app.model.queue.byteTotalDequeues.rate_html(queue)
def render_byte_depth(self, session, queue):
- return self.app.model.queue.byteDepth.value(queue)
+ return 9999
+ #return self.app.model.queue.byteDepth.value(queue)
def render_byte_depth_accel(self, session, queue):
return self.app.model.queue.byteDepth.rate_html(queue)
@@ -449,7 +450,7 @@
self.add_child(chart)
chart = StatValueChart(app, "consumers")
- chart.stats = ("consumers",)
+ chart.stats = ("consumerCount",)
self.add_child(chart)
def render_title(self, session):
17 years, 11 months
rhmessaging commits: r2111 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-02 20:45:18 -0400 (Mon, 02 Jun 2008)
New Revision: 2111
Modified:
mgmt/cumin/python/cumin/model.py
Log:
bz446958 - Format the binary system UUID as something more readable
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-06-02 22:41:32 UTC (rev 2110)
+++ mgmt/cumin/python/cumin/model.py 2008-06-03 00:45:18 UTC (rev 2111)
@@ -5,6 +5,7 @@
from datetime import datetime, timedelta
from types import *
from logging import getLogger
+from struct import unpack
from util import *
from formats import *
@@ -453,7 +454,7 @@
def __init__(self, model):
super(CuminSystem, self).__init__(model, "system", System, SystemStats)
- prop = CuminProperty(self, "sysId")
+ prop = self.SystemIdProperty(self, "systemId")
prop.title = "System ID"
prop = CuminProperty(self, "nodeName")
@@ -488,6 +489,12 @@
def get_object_name(self, object):
return object.nodeName
+ class SystemIdProperty(CuminProperty):
+ def value(self, object):
+ val = super(CuminSystem.SystemIdProperty, self).value(object)
+
+ return "%08x-%04x-%04x-%04x-%04x%08x" % unpack("!LHHHHL", val)
+
class CuminBroker(RemoteClass):
def __init__(self, model):
super(CuminBroker, self).__init__(model, "broker", Broker, BrokerStats)
17 years, 11 months
rhmessaging commits: r2110 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-02 18:41:32 -0400 (Mon, 02 Jun 2008)
New Revision: 2110
Modified:
mgmt/mint/python/mint/__init__.py
Log:
use capitalize()
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-02 22:09:34 UTC (rev 2109)
+++ mgmt/mint/python/mint/__init__.py 2008-06-02 22:41:32 UTC (rev 2110)
@@ -371,7 +371,7 @@
def schemaCallback(self, brokerId, classInfo, configs, metric, methods, events):
self.log("\nSCHEMA---------------------------------------------------")
self.log("BrokerId=%s , ClassInfo[1]=%s" % (brokerId, classInfo[1]))
- cls = schema.schemaNameToClassMap.get(classInfo[1][0].upper() + classInfo[1][1:])
+ cls = schema.schemaNameToClassMap.get(classInfo[1].capitalize())
if cls:
cls.classInfos[brokerId] = classInfo
self.log("\nEND SCHEMA---------------------------------------------------")
@@ -379,7 +379,7 @@
def configCallback(self, brokerId, classInfo, list, timestamps):
self.log("\nCONFIG---------------------------------------------------")
- objectName = classInfo[1][0].upper() + classInfo[1][1:]
+ objectName = classInfo[1].capitalize()
brokerUUID = classInfo[2]
self.log(objectName)
d = self.sanitizeDict(dict(list))
@@ -397,7 +397,7 @@
try:
for parentKey in self.findParentKeys(d):
convertedKey = self.convertRefKey(parentKey)
- cls = schema.schemaNameToClassMap.get(convertedKey[0].upper() + convertedKey[1:])
+ cls = schema.schemaNameToClassMap.get(convertedKey.capitalize())
if (convertedKey == "connection"):
convertedKey = "clientConnection"
if cls:
@@ -422,7 +422,7 @@
def instCallback(self, brokerId, classInfo, list, timestamps):
self.log("\nINST---------------------------------------------------")
- objectName = classInfo[1][0].upper() + classInfo[1][1:]
+ objectName = classInfo[1].capitalize()
brokerUUID = classInfo[2]
self.log(objectName)
d = self.sanitizeDict(dict(list))
17 years, 11 months
rhmessaging commits: r2109 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-02 18:09:34 -0400 (Mon, 02 Jun 2008)
New Revision: 2109
Modified:
mgmt/mint/python/mint/__init__.py
Log:
more upper/lower case schema-related bugfixing
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-02 21:54:24 UTC (rev 2108)
+++ mgmt/mint/python/mint/__init__.py 2008-06-02 22:09:34 UTC (rev 2109)
@@ -368,13 +368,15 @@
def setCloseListener(self, connCloseListener):
self.connCloseListener = connCloseListener
- def schemaCallback(self, brokerId, classInfo,
- configs, metric, methods, events):
- cls = schema.schemaNameToClassMap.get(classInfo[1])
-
+ def schemaCallback(self, brokerId, classInfo, configs, metric, methods, events):
+ self.log("\nSCHEMA---------------------------------------------------")
+ self.log("BrokerId=%s , ClassInfo[1]=%s" % (brokerId, classInfo[1]))
+ cls = schema.schemaNameToClassMap.get(classInfo[1][0].upper() + classInfo[1][1:])
if cls:
cls.classInfos[brokerId] = classInfo
+ self.log("\nEND SCHEMA---------------------------------------------------")
+
def configCallback(self, brokerId, classInfo, list, timestamps):
self.log("\nCONFIG---------------------------------------------------")
objectName = classInfo[1][0].upper() + classInfo[1][1:]
17 years, 11 months
rhmessaging commits: r2108 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-02 17:54:24 -0400 (Mon, 02 Jun 2008)
New Revision: 2108
Modified:
mgmt/cumin/python/cumin/exchange.strings
mgmt/cumin/python/cumin/queue.strings
Log:
Update queries for schema changes
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2008-06-02 21:29:35 UTC (rev 2107)
+++ mgmt/cumin/python/cumin/exchange.strings 2008-06-02 21:54:24 UTC (rev 2108)
@@ -8,8 +8,8 @@
select
e.id,
e.name,
- c.producers,
- c.bindings,
+ c.producer_count as producers,
+ c.binding_count as bindings,
(c.msg_receives - p.msg_receives)
/ (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001) as mreceived,
case when p.msg_receives is null then true else false end as mreceived_is_null,
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2008-06-02 21:29:35 UTC (rev 2107)
+++ mgmt/cumin/python/cumin/queue.strings 2008-06-02 21:54:24 UTC (rev 2108)
@@ -2,8 +2,8 @@
select
q.id,
q.name,
- c.consumers,
- c.bindings,
+ c.consumer_count as consumers,
+ c.binding_count as bindings,
(c.msg_total_enqueues - p.msg_total_enqueues)
/ (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001) as menqueued,
case when p.msg_total_enqueues is null then true else false end as menqueued_is_null,
@@ -17,7 +17,7 @@
/ (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001) as bdequeued,
case when p.byte_total_dequeues is null then true else false end as bdequeued_is_null,
c.msg_depth as mdepth,
- c.byte_depth as bdepth,
+ 999 as bdepth,
1 as mdepthaccel,
1 as bdepthaccel,
c.rec_time
17 years, 11 months
rhmessaging commits: r2107 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-02 17:29:35 -0400 (Mon, 02 Jun 2008)
New Revision: 2107
Modified:
mgmt/mint/python/mint/__init__.py
Log:
workaround class names being sent in all-lowercase; handle name clash on connection attrib
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-02 19:45:30 UTC (rev 2106)
+++ mgmt/mint/python/mint/__init__.py 2008-06-02 21:29:35 UTC (rev 2107)
@@ -354,7 +354,9 @@
return "idOriginal"
def convertRefKey(self, k):
- return k.replace("Ref", "")
+ result = k.replace("Ref", "")
+ result = result[0].lower() + result[1:]
+ return result
def findParentKeys(self, d):
keys = []
@@ -375,7 +377,7 @@
def configCallback(self, brokerId, classInfo, list, timestamps):
self.log("\nCONFIG---------------------------------------------------")
- objectName = classInfo[1]
+ objectName = classInfo[1][0].upper() + classInfo[1][1:]
brokerUUID = classInfo[2]
self.log(objectName)
d = self.sanitizeDict(dict(list))
@@ -393,9 +395,13 @@
try:
for parentKey in self.findParentKeys(d):
convertedKey = self.convertRefKey(parentKey)
- cls = schema.schemaNameToClassMap.get(convertedKey)
+ cls = schema.schemaNameToClassMap.get(convertedKey[0].upper() + convertedKey[1:])
+ if (convertedKey == "connection"):
+ convertedKey = "clientConnection"
if cls:
d[convertedKey] = conn.getByOriginalId(cls, d.pop(parentKey), brokerId)
+ else:
+ self.log("Error: referenced class not found: %s" % convertedKey)
obj = conn.getByOriginalId(schema.schemaNameToClassMap[objectName], d["idOriginal"], brokerId, create=True)
if (not obj):
self.log("Couldn't find type %s id %s" % (objectName, d["idOriginal"]))
@@ -403,10 +409,10 @@
obj.set(**d)
obj.syncUpdate()
except TypeError, detail:
- self.log("Schema mismatch: %s" % detail)
+ self.log("TypeError: Schema mismatch: %s" % detail)
return
except KeyError, detail:
- self.log("Schema mismatch: %s" % detail)
+ self.log("KeyError: Schema mismatch: %s" % detail)
return
self.log("END CONFIG---------------------------------------------------\n")
@@ -414,7 +420,7 @@
def instCallback(self, brokerId, classInfo, list, timestamps):
self.log("\nINST---------------------------------------------------")
- objectName = classInfo[1]
+ objectName = classInfo[1][0].upper() + classInfo[1][1:]
brokerUUID = classInfo[2]
self.log(objectName)
d = self.sanitizeDict(dict(list))
@@ -435,7 +441,10 @@
print "lion", classInfo, list
return
- d[objectName] = obj
+ origObjName = classInfo[1]
+ if (origObjName == "connection"):
+ origObjName = "clientConnection"
+ d[origObjName] = obj
objNameStats = eval("schema.%sStats" % (schema.schemaNameToClassMap[objectName].__name__))
objStats = objNameStats.__new__(objNameStats)
objStats.__init__()
@@ -456,10 +465,10 @@
obj.set(**d)
obj.syncUpdate()
except TypeError, detail:
- self.log("Schema mismatch: %s" % detail)
+ self.log("TypeError: Schema mismatch: %s" % detail)
return
except KeyError, detail:
- self.log("Schema mismatch: %s" % detail)
+ self.log("KeyError: Schema mismatch: %s" % detail)
return
self.log("END INST---------------------------------------------------\n")
17 years, 11 months
rhmessaging commits: r2106 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-02 15:45:30 -0400 (Mon, 02 Jun 2008)
New Revision: 2106
Modified:
mgmt/mint/python/mint/__init__.py
Log:
Adjust some names to avoid collisions
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-02 18:56:36 UTC (rev 2105)
+++ mgmt/mint/python/mint/__init__.py 2008-06-02 19:45:30 UTC (rev 2106)
@@ -1,6 +1,6 @@
import os, socket, qpid, logging
from qpid.datatypes import uuid4
-from qpid.connection import Connection
+from qpid.connection import Connection as QpidConnection
from qpid.util import connect
from qpid.management import managementChannel, managementClient
from datetime import *
@@ -209,7 +209,7 @@
self.exception = e
return
- self.conn = Connection(sock, spec)
+ self.conn = QpidConnection(sock, spec)
self.mclient = managementClient(spec,
self.model.controlCallback,
self.model.configCallback,
17 years, 11 months
rhmessaging commits: r2105 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-02 14:56:36 -0400 (Mon, 02 Jun 2008)
New Revision: 2105
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/demo.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/parameters.py
mgmt/cumin/python/cumin/test.py
mgmt/cumin/python/cumin/virtualhost.py
Log:
Part 1 of the rename of Client to Connection
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-06-02 16:11:13 UTC (rev 2104)
+++ mgmt/cumin/python/cumin/broker.py 2008-06-02 18:56:36 UTC (rev 2105)
@@ -215,11 +215,11 @@
self.__exchange = ExchangeFrame(app, "exchange")
self.add_mode(self.__exchange)
- self.__client = ClientFrame(app, "client")
- self.add_mode(self.__client)
+ self.__conn = ConnectionFrame(app, "conn")
+ self.add_mode(self.__conn)
- self.__clients_close = ClientSetClose(app, "clientsclose")
- self.add_mode(self.__clients_close)
+ self.__conns_close = ConnectionSetClose(app, "connsclose")
+ self.add_mode(self.__conns_close)
def show_queue(self, session, queue):
self.__queue.set_object(session, queue)
@@ -235,14 +235,14 @@
self.page.set_current_frame(session, self.__exchange)
return self.show_mode(session, self.__exchange)
- def show_client(self, session, client):
- self.__client.set_object(session, client)
- self.page.set_current_frame(session, self.__client)
- return self.show_mode(session, self.__client)
+ def show_connection(self, session, conn):
+ self.__conn.set_object(session, conn)
+ self.page.set_current_frame(session, self.__conn)
+ return self.show_mode(session, self.__conn)
- def show_clients_close(self, session):
- self.page.set_current_frame(session, self.__clients_close)
- return self.show_mode(session, self.__clients_close)
+ def show_connections_close(self, session):
+ self.page.set_current_frame(session, self.__conns_close)
+ return self.show_mode(session, self.__conns_close)
class BrokerStatus(CuminStatus):
pass
@@ -267,7 +267,7 @@
self.__tabs.add_tab(self.BrokerQueueTab(app, "queues"))
self.__tabs.add_tab(ExchangeSet(app, "exchanges"))
- self.__tabs.add_tab(ClientSet(app, "clients"))
+ self.__tabs.add_tab(ConnectionSet(app, "conns"))
self.__tabs.add_tab(PeerSet(app, "peers"))
self.__tabs.add_tab(self.BrokerDetailsTab(app, "details"))
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-06-02 16:11:13 UTC (rev 2104)
+++ mgmt/cumin/python/cumin/client.py 2008-06-02 18:56:36 UTC (rev 2105)
@@ -11,9 +11,9 @@
strings = StringCatalog(__file__)
-class ClientSet(CuminTable, Form):
+class ConnectionSet(CuminTable, Form):
def __init__(self, app, name):
- super(ClientSet, self).__init__(app, name)
+ super(ConnectionSet, self).__init__(app, name)
self.ids = CheckboxIdColumn(app, "id", self)
self.add_column(self.ids)
@@ -50,7 +50,7 @@
return self.unit.get(session) == "b" and "Bytes" or "Frames"
def render_title(self, session, vhost):
- return "Clients %s" % fmt_count(vhost.clients.count())
+ return "Connections %s" % fmt_count(vhost.connections.count())
def render_sql_where(self, session, vhost):
elems = list()
@@ -70,7 +70,7 @@
self.parent.ids.clear(session)
branch = session.branch()
- frame = self.frame.show_clients_close(branch)
+ frame = self.frame.show_connections_close(branch)
frame.ids.set(branch, ids)
self.page.set_redirect_url(session, branch.marshal())
@@ -79,10 +79,10 @@
return "Address"
def render_content(self, session, data):
- client = Identifiable(data["id"])
+ conn = Identifiable(data["id"])
branch = session.branch()
- self.frame.show_client(branch, client).show_view(branch)
- return fmt_olink(branch, client, name=data["addr"])
+ self.frame.show_connection(branch, conn).show_view(branch)
+ return fmt_olink(branch, conn, name=data["addr"])
class SentColumn(NullSortColumn, FreshDataOnlyColumn):
def render_title(self, session, data):
@@ -106,24 +106,24 @@
def render_value(self, session, value):
return fmt_rate(value, "", "sec")
-class ClientFrame(CuminFrame):
+class ConnectionFrame(CuminFrame):
def __init__(self, app, name):
- super(ClientFrame, self).__init__(app, name)
+ super(ConnectionFrame, self).__init__(app, name)
- self.object = ClientParameter(app, "id")
+ self.object = ConnectionParameter(app, "id")
self.add_parameter(self.object)
- view = ClientView(app, "view")
+ view = ConnectionView(app, "view")
self.add_mode(view)
self.set_view_mode(view)
- self.__close = ClientClose(app, "close")
+ self.__close = ConnectionClose(app, "close")
self.add_mode(self.__close)
- self.__sessions_detach = ClientSessionSetDetach(app, "sessionsdetach")
+ self.__sessions_detach = SessionSetDetach(app, "sessionsdetach")
self.add_mode(self.__sessions_detach)
- self.__sessions_close = ClientSessionSetClose(app, "sessionsclose")
+ self.__sessions_close = SessionSetClose(app, "sessionsclose")
self.add_mode(self.__sessions_close)
def show_close(self, session):
@@ -141,31 +141,31 @@
#print error, args
#print "did it!"
-class ClientClose(CuminConfirmForm):
+class ConnectionClose(CuminConfirmForm):
def get_args(self, session):
return self.frame.get_args(session)
- def process_cancel(self, session, client):
+ def process_cancel(self, session, conn):
branch = session.branch()
self.frame.show_view(branch)
self.page.set_redirect_url(session, branch.marshal())
- def process_submit(self, session, client):
- action = self.app.model.client.close
- action.invoke(client)
+ def process_submit(self, session, conn):
+ action = self.app.model.connection.close
+ action.invoke(conn)
- self.process_cancel(session, client)
+ self.process_cancel(session, conn)
- def render_title(self, session, client):
- return "Close Client '%s'" % client.address
+ def render_title(self, session, conn):
+ return "Close Connection '%s'" % conn.address
- def render_submit_content(self, session, client):
- return "Yes, Close Client '%s'" % client.address
+ def render_submit_content(self, session, conn):
+ return "Yes, Close Connection '%s'" % conn.address
- def render_cancel_content(self, session, client):
+ def render_cancel_content(self, session, conn):
return "No, Cancel"
-class ClientSetClose(CuminBulkActionForm):
+class ConnectionSetClose(CuminBulkActionForm):
def process_return(self, session):
branch = session.branch()
self.frame.show_view(branch)
@@ -173,42 +173,42 @@
self.page.set_redirect_url(session, branch.marshal())
def process_item(self, session, id):
- client = Client.get(id)
- action = self.app.model.client.close
- action.invoke(client)
+ conn = Connection.get(id)
+ action = self.app.model.connection.close
+ action.invoke(conn)
def render_title(self, session):
- return "Close Clients"
+ return "Close Connections"
def render_item_content(self, session, id):
- return "Close Client %s" % Client.get(id).address
+ return "Close Connection %s" % Client.get(id).address
-class ClientStatus(CuminStatus):
- def render_frames_from(self, session, client):
- return self.app.model.client.framesFromClient.rate_html(client)
+class ConnectionStatus(CuminStatus):
+ def render_frames_from(self, session, conn):
+ return self.app.model.connection.framesFromClient.rate_html(conn)
- def render_frames_to(self, session, client):
- return self.app.model.client.framesToClient.rate_html(client)
+ def render_frames_to(self, session, conn):
+ return self.app.model.connection.framesToClient.rate_html(conn)
- def render_bytes_from(self, session, client):
- return self.app.model.client.bytesFromClient.rate_html(client)
+ def render_bytes_from(self, session, conn):
+ return self.app.model.connection.bytesFromClient.rate_html(conn)
- def render_bytes_to(self, session, client):
- return self.app.model.client.bytesToClient.rate_html(client)
+ def render_bytes_to(self, session, conn):
+ return self.app.model.connection.bytesToClient.rate_html(conn)
-class ClientView(CuminView):
+class ConnectionView(CuminView):
def __init__(self, app, name):
- super(ClientView, self).__init__(app, name)
+ super(ConnectionView, self).__init__(app, name)
- status = ClientStatus(app, "status")
+ status = ConnectionStatus(app, "status")
self.add_child(status)
self.__tabs = TabbedModeSet(app, "tabs")
self.add_child(self.__tabs)
- self.__tabs.add_tab(ClientStats(app, "stats"))
+ self.__tabs.add_tab(ConnectionStats(app, "stats"))
- self.__sessions = ClientSessionSet(app, "sessions")
+ self.__sessions = SessionSet(app, "sessions")
self.__tabs.add_tab(self.__sessions)
self.__tabs.add_tab(CuminDetails(app, "details"))
@@ -216,13 +216,13 @@
def show_sessions(self, session):
return self.__tabs.show_mode(session, self.__sessions)
- def render_script(self, session, client):
- data = "model.xml?class=client;id=%i" % client.id
- return "wooly.setIntervalUpdate('%s', updateClient, 3000)" % data
+ def render_script(self, session, conn):
+ data = "model.xml?class=connection;id=%i" % conn.id
+ return "wooly.setIntervalUpdate('%s', updateConnection, 3000)" % data
-class ClientStats(Widget):
+class ConnectionStats(Widget):
def __init__(self, app, name):
- super(ClientStats, self).__init__(app, name)
+ super(ConnectionStats, self).__init__(app, name)
self.add_child(StatSet(app, "io", "io"))
self.add_child(StatSet(app, "general", "general"))
@@ -235,15 +235,15 @@
class SendReceiveRateChart(StatValueChart):
def __init__(self, app, name):
- super(ClientStats.SendReceiveRateChart, self).__init__(app, name)
+ super(ConnectionStats.SendReceiveRateChart, self).__init__(app, name)
self.stats = ("bytesFromClient", "bytesToClient")
self.mode = "rate"
- def render_title(self, session, client):
+ def render_title(self, session, conn):
return "Bytes Sent and Received"
-class ClientSessionSetDetach(CuminBulkActionForm, Frame):
+class SessionSetDetach(CuminBulkActionForm, Frame):
def process_return(self, session):
branch = session.branch()
self.frame.show_view(branch).show_sessions(branch)
@@ -261,7 +261,7 @@
def render_item_content(self, session, id):
return "Detach Session '%s'" % Session.get(id).name
-class ClientSessionSetClose(CuminBulkActionForm, Frame):
+class SessionSetClose(CuminBulkActionForm, Frame):
def process_return(self, session):
branch = session.branch()
self.frame.show_view(branch).show_sessions(branch)
@@ -279,9 +279,9 @@
def render_item_content(self, session, id):
return "Close Session '%s'" % Session.get(id).name
-class ClientSessionSet(CuminTable, Form):
+class SessionSet(CuminTable, Form):
def __init__(self, app, name):
- super(ClientSessionSet, self).__init__(app, name)
+ super(SessionSet, self).__init__(app, name)
self.ids = CheckboxIdColumn(app, "id", self)
self.add_column(self.ids)
@@ -309,17 +309,17 @@
def get_args(self, session):
return self.frame.get_args(session)
- def render_title(self, session, client):
- return "Sessions %s" % fmt_count(client.sessions.count())
+ def render_title(self, session, conn):
+ return "Sessions %s" % fmt_count(conn.sessions.count())
- def render_sql_where(self, session, client):
+ def render_sql_where(self, session, conn):
elems = list()
- elems.append("s.client_id = %(id)r")
- elems.append(self.__phase.get_sql_constraint(session, client))
+ elems.append("s.client_connection_id = %(id)r")
+ elems.append(self.__phase.get_sql_constraint(session, conn))
return "where %s" % " and ".join(elems)
- def get_sql_values(self, session, client):
- return {"id": client.id}
+ def get_sql_values(self, session, conn):
+ return {"id": conn.id}
class Detach(FormButton):
def render_content(self, session):
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2008-06-02 16:11:13 UTC (rev 2104)
+++ mgmt/cumin/python/cumin/client.strings 2008-06-02 18:56:36 UTC (rev 2105)
@@ -1,4 +1,4 @@
-[ClientSet.sql]
+[ConnectionSet.sql]
select
l.id,
l.address as addr,
@@ -15,27 +15,27 @@
/ (extract(epoch from (c.rec_time - p.rec_time)) + 0.0001) as fr,
case when p.frames_to_client is null then true else false end as fr_is_null,
c.rec_time
-from client as l
-left outer join client_stats as c on c.id = l.stats_curr_id
-left outer join client_stats as p on p.id = l.stats_prev_id
+from connection as l
+left outer join connection_stats as c on c.id = l.stats_curr_id
+left outer join connection_stats as p on p.id = l.stats_prev_id
{sql_where}
{sql_orderby}
{sql_limit}
-[ClientSet.count_sql]
+[ConnectionSet.count_sql]
select count(*)
-from client as l
-left outer join client_stats as c on c.id = l.stats_curr_id
+from connection as l
+left outer join connection_stats as c on c.id = l.stats_curr_id
{sql_where}
-[ClientSet.html]
+[ConnectionSet.html]
<form id="{id}" method="post" action="?">
<div class="rfloat">{phase}</div>
{unit}
<div class="sactions">
- <h2>Act on Selected Clients:</h2>
+ <h2>Act on Selected Connections:</h2>
{close}
</div>
@@ -54,11 +54,11 @@
{hidden_inputs}
</form>
-[ClientStatus.javascript]
-function updateClientStatus(id, client) {
- updateStatus(id, client);
+[ConnectionStatus.javascript]
+function updateConnectionStatus(id, conn) {
+ updateStatus(id, conn);
- var s = client.stat;
+ var s = conn.stat;
var sdata = {
"tr": [
null,
@@ -70,7 +70,7 @@
wooly.doc().elembyid(id).descendant("table.tbody").update(sdata);
}
-[ClientStatus.html]
+[ConnectionStatus.html]
<div id="{id}" class="CuminStatus {color}">
<table>
<tr>
@@ -95,21 +95,21 @@
</script>
[ClientView.javascript]
-function updateClient(data) {
+function updateConnection(data) {
var model = data.objectify();
- var clients = model.client;
- var client;
+ var conns = model.connection;
+ var conn;
- for (var key in clients) {
- client = clients[key];
+ for (var key in conns) {
+ conn = conns[key];
break;
}
cumin.runModelListeners(model);
- cumin.runObjectListeners(client);
+ cumin.runObjectListeners(conn);
}
-[ClientStats.html]
+[ConnectionStats.html]
<table class="twocol">
<tr>
<td>
@@ -125,7 +125,7 @@
</tr>
</table>
-[ClientSessionSet.sql]
+[SessionSet.sql]
select s.id, s.name, c.expire_time as expires, c.attached as status
from session as s
left outer join session_stats as c on c.id = s.stats_curr_id
@@ -134,13 +134,13 @@
{sql_orderby}
{sql_limit}
-[ClientSessionSet.count_sql]
+[SessionSet.count_sql]
select count(*)
from session as s
left outer join session_stats as c on c.id = s.stats_curr_id
{sql_where}
-[ClientSessionSet.html]
+[SessionSet.html]
<form id="{id}" method="post" action="?">
<div class="rfloat">{phase}</div>
Modified: mgmt/cumin/python/cumin/demo.py
===================================================================
--- mgmt/cumin/python/cumin/demo.py 2008-06-02 16:11:13 UTC (rev 2104)
+++ mgmt/cumin/python/cumin/demo.py 2008-06-02 18:56:36 UTC (rev 2105)
@@ -128,10 +128,10 @@
for consumer in queue.consumer_items():
self.frob(consumer)
- for client in vhost.client_items():
- self.frob(client)
+ for conn in vhost.conn_items():
+ self.frob(conn)
- for session in client.session_items():
+ for session in conn.session_items():
self.frob(session)
if __name__ == "__main__":
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-06-02 16:11:13 UTC (rev 2104)
+++ mgmt/cumin/python/cumin/model.py 2008-06-02 18:56:36 UTC (rev 2105)
@@ -25,7 +25,7 @@
CuminQueue(self)
CuminExchange(self)
CuminBinding(self)
- CuminClient(self)
+ CuminConnection(self)
CuminSession(self)
CuminLink(self)
@@ -808,9 +808,10 @@
def get_object_name(self, binding):
return ""
-class CuminClient(RemoteClass):
+class CuminConnection(RemoteClass):
def __init__(self, model):
- super(CuminClient, self).__init__(model, "client", Client, ClientStats)
+ super(CuminConnection, self).__init__(model, "connection", Connection,
+ ConnectionStats)
prop = CuminProperty(self, "address")
prop.title = "Address"
@@ -842,40 +843,40 @@
action = self.Close(self, "close")
action.summary = True
- def show_object(self, session, client):
+ def show_object(self, session, conn):
frame = self.cumin_model.show_main(session)
- frame = frame.show_broker(session, client.vhost.broker.registration)
- return frame.show_client(session, client)
+ frame = frame.show_broker(session, conn.vhost.broker.registration)
+ return frame.show_connection(session, conn)
def get_title(self, session):
- return "Client"
+ return "Connection"
def get_icon_href(self, session):
return "resource?name=client-36.png"
- def get_object_name(self, client):
- return client.address
+ def get_object_name(self, conn):
+ return conn.address
class Close(CuminAction):
- def show(self, session, client):
- frame = self.cumin_class.show_object(session, client)
+ def show(self, session, conn):
+ frame = self.cumin_class.show_object(session, conn)
return frame.show_close(session)
def get_title(self, session):
return "Close"
- def do_invoke(self, client, args, completion):
- reg = client.vhost.broker.registration
- conn = self.cumin_model.data.getConnectionByRegistration(reg)
-
+ def do_invoke(self, conn, args, completion):
+ reg = conn.vhost.broker.registration
+ mconn = self.cumin_model.data.getConnectionByRegistration(reg)
+
# Does it contain a mgmt session?
- for session in client.sessions:
- if session.name == conn.getSessionId():
+ for session in conn.sessions:
+ if session.name == mconn.getSessionId():
raise Exception \
- ("Cannot close management client %s", client.address)
+ ("Cannot close management connection %s", conn.address)
- client.close(self.cumin_model.data, completion)
+ conn.close(self.cumin_model.data, completion)
class CuminSession(RemoteClass):
def __init__(self, model):
@@ -916,29 +917,29 @@
def get_title(self, session):
return "Close"
- def do_invoke(self, object, args, completion):
- reg = object.client.vhost.broker.registration
+ def do_invoke(self, sess, args, completion):
+ reg = sess.conn.vhost.broker.registration
conn = self.cumin_model.data.getConnectionByRegistration(reg)
- if object.name == conn.getSessionId():
+ if sess.name == conn.getSessionId():
raise Exception \
- ("Cannot close management session %s" % object.name)
+ ("Cannot close management session %s" % sess.name)
- object.close(self.cumin_model.data, completion)
+ sess.close(self.cumin_model.data, completion)
class Detach(CuminAction):
def get_title(self, session):
return "Detach"
- def do_invoke(self, object, args, completion):
- reg = object.client.vhost.broker.registration
+ def do_invoke(self, sess, args, completion):
+ reg = sess.clientConnection.vhost.broker.registration
conn = self.cumin_model.data.getConnectionByRegistration(reg)
- if object.name == conn.getSessionId():
+ if sess.name == conn.getSessionId():
raise Exception \
- ("Cannot detach management session %s" % object.name)
+ ("Cannot detach management session %s" % sess.name)
- object.detach(self.cumin_model.data, completion)
+ sess.detach(self.cumin_model.data, completion)
class ResetLifespan(CuminAction):
def get_title(self, session):
Modified: mgmt/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/cumin/python/cumin/parameters.py 2008-06-02 16:11:13 UTC (rev 2104)
+++ mgmt/cumin/python/cumin/parameters.py 2008-06-02 18:56:36 UTC (rev 2105)
@@ -44,12 +44,12 @@
def do_marshal(self, profile):
return str(profile.id)
-class ClientParameter(Parameter):
+class ConnectionParameter(Parameter):
def do_unmarshal(self, string):
- return Client.get(int(string))
+ return Connection.get(int(string))
- def do_marshal(self, client):
- return str(client.id)
+ def do_marshal(self, conn):
+ return str(conn.id)
class ConfigPropertyParameter(Parameter):
def do_unmarshal(self, string):
Modified: mgmt/cumin/python/cumin/test.py
===================================================================
--- mgmt/cumin/python/cumin/test.py 2008-06-02 16:11:13 UTC (rev 2104)
+++ mgmt/cumin/python/cumin/test.py 2008-06-02 18:56:36 UTC (rev 2105)
@@ -336,7 +336,7 @@
QueueTest(env, self)
ExchangeTest(env, self)
- ClientTest(env, self)
+ ConnectionTest(env, self)
def do_run(self, session):
def predicate():
@@ -383,7 +383,7 @@
self.run_children(session)
-class ClientTest(Test):
+class ConnectionTest(Test):
def do_run(self, session):
raise Exception("Not implemented")
@@ -392,9 +392,10 @@
str(self.env.broker_conn.port)
try:
- self.env.client = Client.selectBy(vhost=vhost, address=address)[0]
+ self.env.conn = Connection.selectBy \
+ (vhost=vhost, address=address)[0]
except IndexError:
- raise Exception("Client not found")
+ raise Exception("Connection not found")
self.run_children(session)
Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py 2008-06-02 16:11:13 UTC (rev 2104)
+++ mgmt/cumin/python/cumin/virtualhost.py 2008-06-02 18:56:36 UTC (rev 2105)
@@ -41,8 +41,8 @@
self.__exchange = ExchangeFrame(app, "exchange")
self.add_mode(self.__exchange)
- self.__client = ClientFrame(app, "client")
- self.add_mode(self.__client)
+ self.__conn = ConnectionFrame(app, "conn")
+ self.add_mode(self.__conn)
def show_queue(self, session, queue):
self.__queue.set_object(session, queue)
@@ -52,9 +52,9 @@
self.__exchange.set_object(session, exchange)
return self.show_mode(session, self.__exchange)
- def show_client(self, session, client):
- self.__client.set_object(session, client)
- return self.show_mode(session, self.__client)
+ def show_connection(self, session, conn):
+ self.__conn.set_object(session, conn)
+ return self.show_mode(session, self.__conn)
class VirtualHostView(CuminView):
def __init__(self, app, name):
@@ -65,7 +65,7 @@
self.tabs.add_tab(QueueSet(app, "queues"))
self.tabs.add_tab(ExchangeSet(app, "exchanges"))
- self.tabs.add_tab(ClientSet(app, "clients"))
+ self.tabs.add_tab(ConnectionSet(app, "conns"))
def render_broker_link(self, session, vhost):
broker = vhost.get_broker()
17 years, 11 months
rhmessaging commits: r2104 - in store/branches/java/M2.1.x: java/bdbstore and 4 other directories.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2008-06-02 12:11:13 -0400 (Mon, 02 Jun 2008)
New Revision: 2104
Added:
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/QueueDeleteWhilstRoutingTest.java
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java
Removed:
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java
Modified:
store/branches/java/M2.1.x/
store/branches/java/M2.1.x/java/bdbstore/pom.xml
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreTest.java
store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java
Log:
Merged revisions 2068-2103 via svnmerge from
https://svn.jboss.org/repos/rhmessaging/store/branches/java/M2.x
........
r2101 | ritchiem | 2008-06-02 15:29:56 +0100 (Mon, 02 Jun 2008) | 5 lines
QPID-1101, QPID-1103 :Added BDBVMTestCase to allow the clean up of BDB files on disk for InVM brokers based using persistentn configuration. Updated StoreContextRaceConditionTest.java to utilise these methods.
QueueDeleteWhilstRoutingTest added to check against one cause of MetaData exceptions.
BDBStoreTest.java also edited to extends BDBVMTestCase.java to utilise deleteDirectory method.
Known issues: VMTestCase still creates an inVMBroker in the setUp method. This is to easy development on Qpid M2x but results in additional work directory being created on disk.
........
Property changes on: store/branches/java/M2.1.x
___________________________________________________________________
Name: svnmerge-integrated
- /store/branches/java/M2.x:1-2067
+ /store/branches/java/M2.x:1-2103
Modified: store/branches/java/M2.1.x/java/bdbstore/pom.xml
===================================================================
--- store/branches/java/M2.1.x/java/bdbstore/pom.xml 2008-06-02 16:05:18 UTC (rev 2103)
+++ store/branches/java/M2.1.x/java/bdbstore/pom.xml 2008-06-02 16:11:13 UTC (rev 2104)
@@ -52,10 +52,6 @@
</dependency>
<dependency>
<groupId>org.apache.qpid</groupId>
- <artifactId>qpid-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
<artifactId>qpid-perftests</artifactId>
</dependency>
<dependency>
@@ -88,12 +84,24 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
+ <forkMode>always</forkMode>
<systemProperties>
<property>
<name>QPID_HOME</name>
- <value>${basedir}/${topDirectoryLocation}/broker</value>
+ <value>${basedir}\${topDirectoryLocation}\broker</value>
</property>
+ <property>
+ <name>BDB_WORK</name>
+ <value>${basedir}\${topDirectoryLocation}\bdbstore\target\qpidWork</value>
+ </property>
+ <property>
+ <name>amqj.logging.level</name>
+ <value>${amqj.logging.level}</value>
+ </property>
</systemProperties>
+ <excludes>
+ <exclude>**/BDBVMTestCase.class</exclude>
+ </excludes>
</configuration>
</plugin>
Modified: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreTest.java
===================================================================
--- store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreTest.java 2008-06-02 16:05:18 UTC (rev 2103)
+++ store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBStoreTest.java 2008-06-02 16:11:13 UTC (rev 2104)
@@ -19,36 +19,40 @@
import com.sleepycat.je.DatabaseException;
import junit.framework.Assert;
-import junit.framework.TestCase;
import junit.framework.TestSuite;
+import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.log4j.Logger;
import org.apache.mina.common.ByteBuffer;
import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.BasicContentHeaderProperties;
+import org.apache.qpid.framing.ContentHeaderBody;
+import org.apache.qpid.framing.MethodRegistry;
+import org.apache.qpid.framing.ProtocolVersion;
import org.apache.qpid.framing.abstraction.ContentChunk;
+import org.apache.qpid.framing.abstraction.MessagePublishInfo;
import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.store.StoreContext;
import org.apache.qpid.server.queue.AMQQueue;
import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.server.queue.QueueRegistry;
import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.store.StoreContext;
import org.apache.qpid.server.txn.NonTransactionalContext;
import org.apache.qpid.server.txn.TransactionalContext;
import org.apache.qpid.server.util.NullApplicationRegistry;
-import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.etp.qpid.testutil.BDBVMTestCase;
import java.io.File;
+import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
-import java.util.HashSet;
-public class BDBStoreTest extends TestCase
+public class BDBStoreTest extends BDBVMTestCase
{
private static final Logger _log = Logger.getLogger(BDBStoreTest.class);
private BDBMessageStore _store;
+ private String STORE_LOCATION = System.getProperty("BDB_WORK") + "/bdbTestEnv";
private StoreContext _storeContext = new StoreContext();
private VirtualHost _virtualHost;
@@ -65,16 +69,10 @@
{
ApplicationRegistry.initialise(new NullApplicationRegistry());
- File bdbDir = new File("bdbTestEnv");
- if (bdbDir.exists())
- {
- File[] entries = bdbDir.listFiles();
- for (File f : entries)
- {
- f.delete();
- }
- bdbDir.delete();
- }
+ File bdbDir = new File(STORE_LOCATION);
+
+ deleteDirectory(bdbDir);
+
bdbDir.mkdirs();
_store = new BDBMessageStore();
@@ -386,7 +384,7 @@
PropertiesConfiguration env = new PropertiesConfiguration();
- env.addProperty("store.environment-path", "bdbTestEnv");
+ env.addProperty("store.environment-path", STORE_LOCATION);
env.addProperty("store.class", "org.apache.qpid.server.store.berkeleydb.BDBMessageStore");
_virtualHost = new VirtualHost("test", env);
Copied: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/QueueDeleteWhilstRoutingTest.java (from rev 2101, store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/server/QueueDeleteWhilstRoutingTest.java)
===================================================================
--- store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/QueueDeleteWhilstRoutingTest.java (rev 0)
+++ store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/QueueDeleteWhilstRoutingTest.java 2008-06-02 16:11:13 UTC (rev 2104)
@@ -0,0 +1,206 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.etp.qpid.server;
+
+import org.apache.log4j.Logger;
+import org.etp.qpid.testutil.BDBVMTestCase;
+
+import javax.jms.Connection;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageListener;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.NamingException;
+import java.io.File;
+
+public class QueueDeleteWhilstRoutingTest extends BDBVMTestCase
+{
+ private static final Logger _logger = Logger.getLogger(QueueDeleteWhilstRoutingTest.class);
+
+ protected Queue _queue;
+ MessageConsumer _consumer1, _consumer2;
+ Session _clientSession1;
+ Connection _producerConnection, _clientConnection1;
+
+ int brokerID = 2;
+
+ /**
+ * Issue analysis:
+ * When an Exclusive NonDurable queue is created a queueDelete task is added to the sessionCloseTaskList
+ * When the last consumer on an autodelete queue closes queueDelete is called.
+ *
+ * Hence the queue is delted twice. Which would hurt the ref counting of all messages in the consumers
+ * unacked map
+ *
+ * Test Plan:
+ *
+ * Create two subscribers same topic
+ *
+ * Send two messages
+ *
+ * consume one from each consumer to validate that all is good
+ *
+ * Shutdown persistent broker
+ *
+ * restart.
+ *
+ * Expecting failure in broker startup.
+ */
+ public void test() throws NamingException, JMSException
+ {
+ _logger.debug("Performing receives");
+
+ Message msg1 = _consumer1.receive(1000);
+
+ assertNotNull(msg1);
+
+ //Check message recevied ok
+ assertEquals("Message 1 not received on consumer 1", "Message: 1", ((TextMessage) msg1).getText());
+
+ _consumer1.close();
+
+ _clientConnection1.close();
+
+ _producerConnection.close();
+
+ try
+ {
+ _logger.debug("Shutdown broker in 1 second");
+ Thread.sleep(4000);
+ }
+ catch (InterruptedException e)
+ {
+ fail(e.getMessage());
+ }
+
+ //Stop the broker
+ stopVMBroker(brokerID);
+
+ try
+ {
+ _logger.debug("Restart broker in 2 second");
+ Thread.sleep(4000);
+ }
+ catch (InterruptedException e)
+ {
+ fail(e.getMessage());
+ }
+
+ //Start the broker
+ try
+ {
+ startVMBroker(brokerID, _persistentConfigFile);
+ }
+ catch (Exception e)
+ {
+ fail(e.getMessage());
+ }
+
+ //Test Connection
+ _clientConnection1 = ((ConnectionFactory) _context.lookup("connection2")).createConnection();
+
+ _clientConnection1.close();
+ }
+
+ public void setUp() throws Exception
+ {
+ _connections.put("connection2", "amqp://guest:guest@" + this.getClass().getName() + "/test?brokerlist='vm://:" + brokerID + "'");
+
+ super.setUp();
+
+ startVMBroker(brokerID, _persistentConfigFile);
+
+ // Initialise ACLs.
+
+ //Create Consumers
+ //Create consumer on the temp queue
+ Queue requestQueue = (Queue) _context.lookup("queue");
+
+ _clientConnection1 = ((ConnectionFactory) _context.lookup("connection2")).createConnection();
+ _clientSession1 = _clientConnection1.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ _queue = _clientSession1.createTemporaryQueue();
+
+ _consumer1 = _clientSession1.createConsumer(_queue);
+
+ //Start the connection
+ _clientConnection1.start();
+
+ //Create Producer
+ _producerConnection = ((ConnectionFactory) _context.lookup("connection2")).createConnection();
+ final Session producerSession = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+ //Create a listener for the messages
+ producerSession.createConsumer(requestQueue).setMessageListener(new MessageListener()
+ {
+ public void onMessage(final Message message)
+ {
+ try
+ {
+ Destination responseQueue = message.getJMSReplyTo();
+
+ //Send a response to the message
+ producerSession.createProducer(responseQueue)
+ .send(producerSession.createTextMessage(((TextMessage) message).getText()));
+ }
+ catch (JMSException e)
+ {
+ fail(e.getMessage());
+ }
+ }
+ });
+ //Start the connection
+ _producerConnection.start();
+
+ //Send two messages
+
+ MessageProducer _clientProducer = _clientSession1.createProducer(requestQueue);
+ Message msg = _clientSession1.createTextMessage("Message: 1");
+ msg.setJMSReplyTo(_queue);
+ _clientProducer.send(msg);
+
+ msg = _clientSession1.createTextMessage("Message: 2");
+ msg.setJMSReplyTo(_queue);
+ _clientProducer.send(msg);
+ }
+
+ public void tearDown() throws Exception
+ {
+ //Stop the broker
+ try
+ {
+ stopVMBroker(brokerID);
+ }
+ catch (Exception e)
+ {
+ fail(e.getMessage());
+ }
+
+ super.tearDown();
+ }
+
+}
Modified: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java
===================================================================
--- store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java 2008-06-02 16:05:18 UTC (rev 2103)
+++ store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/server/StoreContextRaceConditionTest.java 2008-06-02 16:11:13 UTC (rev 2104)
@@ -24,11 +24,10 @@
import org.apache.commons.configuration.Configuration;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
-import org.apache.log4j.BasicConfigurator;
import org.apache.qpid.server.registry.ApplicationRegistry;
import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.test.VMTestCase;
+import org.etp.qpid.testutil.BDBVMTestCase;
import javax.jms.Connection;
import javax.jms.ConnectionFactory;
@@ -41,7 +40,7 @@
import javax.naming.NamingException;
import java.io.File;
-public class StoreContextRaceConditionTest extends VMTestCase
+public class StoreContextRaceConditionTest extends BDBVMTestCase
{
private static final Logger _logger = Logger.getLogger(StoreContextRaceConditionTest.class);
private long _TimeToLive = 0L;
@@ -55,26 +54,13 @@
{
//Disable the logging
_loggingOriginal = System.getProperty(LOGGING_KEY);
- System.setProperty(LOGGING_KEY, "WARN");
+ System.setProperty(LOGGING_KEY, Level.WARN.toString());
- // Initialise ACLs.
- final String qpidHome = System.getProperty("QPID_HOME");
+ //Set the Work Directory
+ setupWorkDirectory();
- final File defaultaclConfigFile = new File(qpidHome, "etc/persistent_config.xml");
+ Configuration configuration = ConfigurationFileApplicationRegistry.config(_persistentConfigFile);
- if (!defaultaclConfigFile.exists())
- {
- System.err.println("Configuration file not found:" + defaultaclConfigFile);
- fail("Configuration file not found:" + defaultaclConfigFile);
- }
-
- if (System.getProperty("QPID_HOME") == null)
- {
- fail("QPID_HOME not set");
- }
-
- Configuration configuration = ConfigurationFileApplicationRegistry.config(defaultaclConfigFile);
-
//Reset the housekeeping threads to run every second.
configuration.setProperty("virtualhosts.virtualhost.test.housekeeping.expiredMessageCheckPeriod", 10 * SECOND);
configuration.setProperty("management.enabled", "false");
@@ -98,12 +84,9 @@
public void tearDown() throws Exception
{
- // Destroy the Broker
+ System.setProperty(LOGGING_KEY, _loggingOriginal);
+
super.tearDown();
- if (_loggingOriginal != null)
- {
- System.setProperty(LOGGING_KEY, _loggingOriginal);
- }
}
protected static final String MESSAGE_ID_PROPERTY = "MessageIDProperty";
@@ -177,8 +160,8 @@
try
{
- int run = 1;
- while (run < 5)
+ int run = 0;
+ while (run < 1)
{
try
{
@@ -268,7 +251,7 @@
scrc.setUp();
scrc.test();
- scrc.tearDown();
+// scrc.tearDown();
}
}
Copied: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil (from rev 2101, store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/testutil)
Deleted: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java
===================================================================
--- store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java 2008-06-02 14:29:56 UTC (rev 2101)
+++ store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java 2008-06-02 16:11:13 UTC (rev 2104)
@@ -1,107 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.etp.qpid.testutil;
-
-import org.apache.qpid.test.VMTestCase;
-
-import java.io.File;
-
-public class BDBVMTestCase extends VMTestCase
-{
- public static final String BDB_WORK = "BDB_WORK";
- public static final String QPID_WORK = "QPID_WORK";
-
- protected String testWork = null;
-
- protected String BDB_WORK_PRE_TEST;
- protected String QPID_WORK_PRE_TEST;
-
- protected final String QpidHome = System.getProperty("QPID_HOME");
- protected final File _persistentConfigFile = new File(QpidHome, "etc/persistent_config.xml");
-
- public void setUp() throws Exception
- {
- setupWorkDirectory();
- super.setUp();
- }
-
- public void tearDown() throws Exception
- {
- super.tearDown();
-
- if (testWork != null)
- {
- // Clean up the BDB store
- deleteDirectory(new File(testWork));
- testWork = null;
- }
-
- //Reset BDB_WORK
- System.setProperty(BDB_WORK, BDB_WORK_PRE_TEST == null ? "" : BDB_WORK_PRE_TEST);
-
- //Reset QPID_WORK
- System.setProperty(QPID_WORK, QPID_WORK_PRE_TEST == null ? "" : QPID_WORK_PRE_TEST);
- }
-
- public void setupWorkDirectory()
- {
- if (System.getProperty(BDB_WORK) == null)
- {
- fail("BDB_WORK required for BDB tests");
- }
-
- BDB_WORK_PRE_TEST = System.getProperty(BDB_WORK);
- QPID_WORK_PRE_TEST = System.getProperty(QPID_WORK);
-
- //IF BDB_WORK is set but not QPID_WORK then set QPID_WORK to BDB_WORK
- if (QPID_WORK_PRE_TEST == null && BDB_WORK_PRE_TEST != null)
- {
- System.setProperty(QPID_WORK, BDB_WORK_PRE_TEST);
- }
- }
-
- public void startVMBroker(int vmID, File configFile)
- {
- testWork = BDB_WORK_PRE_TEST + "-" + vmID;
- System.setProperty(BDB_WORK, testWork);
- System.setProperty(QPID_WORK, testWork);
-
- super.startVMBroker(vmID, configFile);
- }
-
- public boolean deleteDirectory(File dir)
- {
- if (dir.isDirectory())
- {
- String[] children = dir.list();
- for (int i = 0; i < children.length; i++)
- {
- if (!deleteDirectory(new File(dir, children[i])))
- {
- return false;
- }
- }
- }
-
- return (dir.delete());
- }
-
-}
Copied: store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java (from rev 2101, store/branches/java/M2.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java)
===================================================================
--- store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java (rev 0)
+++ store/branches/java/M2.1.x/java/bdbstore/src/test/java/org/etp/qpid/testutil/BDBVMTestCase.java 2008-06-02 16:11:13 UTC (rev 2104)
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.etp.qpid.testutil;
+
+import org.apache.qpid.test.VMTestCase;
+
+import java.io.File;
+
+public class BDBVMTestCase extends VMTestCase
+{
+ public static final String BDB_WORK = "BDB_WORK";
+ public static final String QPID_WORK = "QPID_WORK";
+
+ protected String testWork = null;
+
+ protected String BDB_WORK_PRE_TEST;
+ protected String QPID_WORK_PRE_TEST;
+
+ protected final String QpidHome = System.getProperty("QPID_HOME");
+ protected final File _persistentConfigFile = new File(QpidHome, "etc/persistent_config.xml");
+
+ public void setUp() throws Exception
+ {
+ setupWorkDirectory();
+ super.setUp();
+ }
+
+ public void tearDown() throws Exception
+ {
+ super.tearDown();
+
+ if (testWork != null)
+ {
+ // Clean up the BDB store
+ deleteDirectory(new File(testWork));
+ testWork = null;
+ }
+
+ //Reset BDB_WORK
+ System.setProperty(BDB_WORK, BDB_WORK_PRE_TEST == null ? "" : BDB_WORK_PRE_TEST);
+
+ //Reset QPID_WORK
+ System.setProperty(QPID_WORK, QPID_WORK_PRE_TEST == null ? "" : QPID_WORK_PRE_TEST);
+ }
+
+ public void setupWorkDirectory()
+ {
+ if (System.getProperty(BDB_WORK) == null)
+ {
+ fail("BDB_WORK required for BDB tests");
+ }
+
+ BDB_WORK_PRE_TEST = System.getProperty(BDB_WORK);
+ QPID_WORK_PRE_TEST = System.getProperty(QPID_WORK);
+
+ //IF BDB_WORK is set but not QPID_WORK then set QPID_WORK to BDB_WORK
+ if (QPID_WORK_PRE_TEST == null && BDB_WORK_PRE_TEST != null)
+ {
+ System.setProperty(QPID_WORK, BDB_WORK_PRE_TEST);
+ }
+ }
+
+ public void startVMBroker(int vmID, File configFile)
+ {
+ testWork = BDB_WORK_PRE_TEST + "-" + vmID;
+ System.setProperty(BDB_WORK, testWork);
+ System.setProperty(QPID_WORK, testWork);
+
+ super.startVMBroker(vmID, configFile);
+ }
+
+ public boolean deleteDirectory(File dir)
+ {
+ if (dir.isDirectory())
+ {
+ String[] children = dir.list();
+ for (int i = 0; i < children.length; i++)
+ {
+ if (!deleteDirectory(new File(dir, children[i])))
+ {
+ return false;
+ }
+ }
+ }
+
+ return (dir.delete());
+ }
+
+}
17 years, 11 months
rhmessaging commits: r2103 - in mgmt/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-02 12:05:18 -0400 (Mon, 02 Jun 2008)
New Revision: 2103
Modified:
mgmt/mint/python/mint/schema.py
mgmt/mint/python/mint/schemaparser.py
mgmt/mint/sql/indexes.sql
mgmt/mint/sql/schema.sql
Log:
changes to the model to reflect QPID-1113 - Management cleanup and performance enhancements
Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py 2008-06-02 16:02:23 UTC (rev 2102)
+++ mgmt/mint/python/mint/schema.py 2008-06-02 16:05:18 UTC (rev 2103)
@@ -13,7 +13,7 @@
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('SystemStats', cascade='null', default=None)
statsPrev = ForeignKey('SystemStats', cascade='null', default=None)
- sysId = BLOBCol(default=None)
+ systemId = BLOBCol(default=None)
osName = StringCol(length=1000, default=None)
nodeName = StringCol(length=1000, default=None)
release = StringCol(length=1000, default=None)
@@ -130,7 +130,7 @@
sessionId = BLOBCol(default=None)
label = StringCol(length=1000, default=None)
registeredTo = BigIntCol(default=None)
- sysId = BLOBCol(default=None)
+ systemId = BLOBCol(default=None)
classInfos = dict() # brokerId => classInfo
@@ -224,17 +224,12 @@
msgPersistEnqueues = BigIntCol(default=None)
msgPersistDequeues = BigIntCol(default=None)
msgDepth = IntCol(default=None)
- msgDepthLow = IntCol(default=None)
- msgDepthHigh = IntCol(default=None)
byteTotalEnqueues = BigIntCol(default=None)
byteTotalDequeues = BigIntCol(default=None)
byteTxnEnqueues = BigIntCol(default=None)
byteTxnDequeues = BigIntCol(default=None)
bytePersistEnqueues = BigIntCol(default=None)
bytePersistDequeues = BigIntCol(default=None)
- byteDepth = IntCol(default=None)
- byteDepthLow = IntCol(default=None)
- byteDepthHigh = IntCol(default=None)
enqueueTxnStarts = BigIntCol(default=None)
enqueueTxnCommits = BigIntCol(default=None)
enqueueTxnRejects = BigIntCol(default=None)
@@ -247,12 +242,12 @@
dequeueTxnCount = IntCol(default=None)
dequeueTxnCountLow = IntCol(default=None)
dequeueTxnCountHigh = IntCol(default=None)
- consumers = IntCol(default=None)
- consumersLow = IntCol(default=None)
- consumersHigh = IntCol(default=None)
- bindings = IntCol(default=None)
- bindingsLow = IntCol(default=None)
- bindingsHigh = IntCol(default=None)
+ consumerCount = IntCol(default=None)
+ consumerCountLow = IntCol(default=None)
+ consumerCountHigh = IntCol(default=None)
+ bindingCount = IntCol(default=None)
+ bindingCountLow = IntCol(default=None)
+ bindingCountHigh = IntCol(default=None)
unackedMessages = IntCol(default=None)
unackedMessagesLow = IntCol(default=None)
unackedMessagesHigh = IntCol(default=None)
@@ -294,12 +289,12 @@
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
exchange = ForeignKey('Exchange', cascade='null', default=None)
- producers = IntCol(default=None)
- producersLow = IntCol(default=None)
- producersHigh = IntCol(default=None)
- bindings = IntCol(default=None)
- bindingsLow = IntCol(default=None)
- bindingsHigh = IntCol(default=None)
+ producerCount = IntCol(default=None)
+ producerCountLow = IntCol(default=None)
+ producerCountHigh = IntCol(default=None)
+ bindingCount = IntCol(default=None)
+ bindingCountLow = IntCol(default=None)
+ bindingCountHigh = IntCol(default=None)
msgReceives = BigIntCol(default=None)
msgDrops = BigIntCol(default=None)
msgRoutes = BigIntCol(default=None)
@@ -349,7 +344,7 @@
Binding.sqlmeta.addJoin(SQLMultipleJoin('BindingStats', joinMethodName='stats'))
-class Client(SQLObject):
+class Connection(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -358,8 +353,8 @@
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- statsCurr = ForeignKey('ClientStats', cascade='null', default=None)
- statsPrev = ForeignKey('ClientStats', cascade='null', default=None)
+ statsCurr = ForeignKey('ConnectionStats', cascade='null', default=None)
+ statsPrev = ForeignKey('ConnectionStats', cascade='null', default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
address = StringCol(length=1000, default=None)
incoming = BoolCol(default=None)
@@ -373,16 +368,16 @@
conn.callMethod(self.idOriginal, classInfo, "close",
callback, args=actualArgs)
-Vhost.sqlmeta.addJoin(SQLMultipleJoin('Client', joinMethodName='clients'))
+Vhost.sqlmeta.addJoin(SQLMultipleJoin('Connection', joinMethodName='connections'))
-class ClientStats(SQLObject):
+class ConnectionStats(SQLObject):
class sqlmeta:
lazyUpdate = True
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
- client = ForeignKey('Client', cascade='null', default=None)
+ clientConnection = ForeignKey('Connection', cascade='null', default=None)
closing = BoolCol(default=None)
authIdentity = StringCol(length=1000, default=None)
framesFromClient = BigIntCol(default=None)
@@ -392,7 +387,7 @@
classInfos = dict() # brokerId => classInfo
-Client.sqlmeta.addJoin(SQLMultipleJoin('ClientStats', joinMethodName='stats'))
+Connection.sqlmeta.addJoin(SQLMultipleJoin('ConnectionStats', joinMethodName='stats'))
class Link(SQLObject):
@@ -421,7 +416,7 @@
conn.callMethod(self.idOriginal, classInfo, "close",
callback, args=actualArgs)
- def bridge(self, model, callback, durable, src, dest, key, tag, excludes, src_is_queue, src_is_local):
+ def bridge(self, model, callback, durable, src, dest, key, tag, excludes, srcIsQueue, srcIsLocal):
"""Bridge messages over the link"""
actualArgs = dict()
actualArgs["durable"] = durable
@@ -430,8 +425,8 @@
actualArgs["key"] = key
actualArgs["tag"] = tag
actualArgs["excludes"] = excludes
- actualArgs["src_is_queue"] = src_is_queue
- actualArgs["src_is_local"] = src_is_local
+ actualArgs["srcIsQueue"] = srcIsQueue
+ actualArgs["srcIsLocal"] = srcIsLocal
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
conn.callMethod(self.idOriginal, classInfo, "bridge",
@@ -516,7 +511,7 @@
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
channelId = SmallIntCol(default=None)
- client = ForeignKey('Client', cascade='null', default=None)
+ clientConnection = ForeignKey('Connection', cascade='null', default=None)
detachedLifespan = IntCol(default=None)
classInfos = dict() # brokerId => classInfo
@@ -551,7 +546,7 @@
Vhost.sqlmeta.addJoin(SQLMultipleJoin('Session', joinMethodName='sessions'))
-Client.sqlmeta.addJoin(SQLMultipleJoin('Session', joinMethodName='sessions'))
+Connection.sqlmeta.addJoin(SQLMultipleJoin('Session', joinMethodName='sessions'))
class SessionStats(SQLObject):
@@ -570,175 +565,27 @@
Session.sqlmeta.addJoin(SQLMultipleJoin('SessionStats', joinMethodName='stats'))
-class Destination(SQLObject):
- class sqlmeta:
- lazyUpdate = True
-
- idOriginal = BigIntCol(default=None)
- recTime = TimestampCol(default=None)
- creationTime = TimestampCol(default=None)
- deletionTime = TimestampCol(default=None)
- managedBroker = StringCol(length=1000, default=None)
- statsCurr = ForeignKey('DestinationStats', cascade='null', default=None)
- statsPrev = ForeignKey('DestinationStats', cascade='null', default=None)
- session = ForeignKey('Session', cascade='null', default=None)
- name = StringCol(length=1000, default=None)
-
- classInfos = dict() # brokerId => classInfo
-
- def throttle(self, model, callback, strength):
- """Apply extra rate limiting to destination: 0 = Normal, 10 = Maximum"""
- actualArgs = dict()
- actualArgs["strength"] = strength
- conn = model.connections[self.managedBroker]
- classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "throttle",
- callback, args=actualArgs)
-
- def stop(self, model, callback):
- actualArgs = dict()
- conn = model.connections[self.managedBroker]
- classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "stop",
- callback, args=actualArgs)
-
- def start(self, model, callback):
- actualArgs = dict()
- conn = model.connections[self.managedBroker]
- classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "start",
- callback, args=actualArgs)
-
-Session.sqlmeta.addJoin(SQLMultipleJoin('Destination', joinMethodName='destinations'))
-
-
-class DestinationStats(SQLObject):
- class sqlmeta:
- lazyUpdate = True
-
- idOriginal = BigIntCol(default=None)
- recTime = TimestampCol(default=None)
- destination = ForeignKey('Destination', cascade='null', default=None)
- flowMode = SmallIntCol(default=None)
- maxMsgCredits = IntCol(default=None)
- maxByteCredits = IntCol(default=None)
- msgCredits = IntCol(default=None)
- byteCredits = IntCol(default=None)
-
- classInfos = dict() # brokerId => classInfo
-
-Destination.sqlmeta.addJoin(SQLMultipleJoin('DestinationStats', joinMethodName='stats'))
-
-
-class Producer(SQLObject):
- class sqlmeta:
- lazyUpdate = True
-
- idOriginal = BigIntCol(default=None)
- recTime = TimestampCol(default=None)
- creationTime = TimestampCol(default=None)
- deletionTime = TimestampCol(default=None)
- managedBroker = StringCol(length=1000, default=None)
- statsCurr = ForeignKey('ProducerStats', cascade='null', default=None)
- statsPrev = ForeignKey('ProducerStats', cascade='null', default=None)
- destination = ForeignKey('Destination', cascade='null', default=None)
- exchange = ForeignKey('Exchange', cascade='null', default=None)
-
- classInfos = dict() # brokerId => classInfo
-
-Destination.sqlmeta.addJoin(SQLMultipleJoin('Producer', joinMethodName='producers'))
-
-Exchange.sqlmeta.addJoin(SQLMultipleJoin('Producer', joinMethodName='producers'))
-
-
-class ProducerStats(SQLObject):
- class sqlmeta:
- lazyUpdate = True
-
- idOriginal = BigIntCol(default=None)
- recTime = TimestampCol(default=None)
- producer = ForeignKey('Producer', cascade='null', default=None)
- msgsProduced = BigIntCol(default=None)
- bytesProduced = BigIntCol(default=None)
-
- classInfos = dict() # brokerId => classInfo
-
-Producer.sqlmeta.addJoin(SQLMultipleJoin('ProducerStats', joinMethodName='stats'))
-
-
-class Consumer(SQLObject):
- class sqlmeta:
- lazyUpdate = True
-
- idOriginal = BigIntCol(default=None)
- recTime = TimestampCol(default=None)
- creationTime = TimestampCol(default=None)
- deletionTime = TimestampCol(default=None)
- managedBroker = StringCol(length=1000, default=None)
- statsCurr = ForeignKey('ConsumerStats', cascade='null', default=None)
- statsPrev = ForeignKey('ConsumerStats', cascade='null', default=None)
- destination = ForeignKey('Destination', cascade='null', default=None)
- queue = ForeignKey('Queue', cascade='null', default=None)
-
- classInfos = dict() # brokerId => classInfo
-
- def close(self, model, callback):
- actualArgs = dict()
- conn = model.connections[self.managedBroker]
- classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "close",
- callback, args=actualArgs)
-
-Destination.sqlmeta.addJoin(SQLMultipleJoin('Consumer', joinMethodName='consumers'))
-
-Queue.sqlmeta.addJoin(SQLMultipleJoin('Consumer', joinMethodName='consumers'))
-
-
-class ConsumerStats(SQLObject):
- class sqlmeta:
- lazyUpdate = True
-
- idOriginal = BigIntCol(default=None)
- recTime = TimestampCol(default=None)
- consumer = ForeignKey('Consumer', cascade='null', default=None)
- msgsConsumed = BigIntCol(default=None)
- bytesConsumed = BigIntCol(default=None)
- unackedMessages = IntCol(default=None)
- unackedMessagesLow = IntCol(default=None)
- unackedMessagesHigh = IntCol(default=None)
-
- classInfos = dict() # brokerId => classInfo
-
-Consumer.sqlmeta.addJoin(SQLMultipleJoin('ConsumerStats', joinMethodName='stats'))
-
-
classToSchemaNameMap = dict()
schemaNameToClassMap = dict()
-classToSchemaNameMap['System'] = 'system'
-schemaNameToClassMap['system'] = System
-classToSchemaNameMap['Broker'] = 'broker'
-schemaNameToClassMap['broker'] = Broker
-classToSchemaNameMap['Agent'] = 'agent'
-schemaNameToClassMap['agent'] = Agent
-classToSchemaNameMap['Vhost'] = 'vhost'
-schemaNameToClassMap['vhost'] = Vhost
-classToSchemaNameMap['Queue'] = 'queue'
-schemaNameToClassMap['queue'] = Queue
-classToSchemaNameMap['Exchange'] = 'exchange'
-schemaNameToClassMap['exchange'] = Exchange
-classToSchemaNameMap['Binding'] = 'binding'
-schemaNameToClassMap['binding'] = Binding
-classToSchemaNameMap['Client'] = 'client'
-schemaNameToClassMap['client'] = Client
-classToSchemaNameMap['Link'] = 'link'
-schemaNameToClassMap['link'] = Link
-classToSchemaNameMap['Bridge'] = 'bridge'
-schemaNameToClassMap['bridge'] = Bridge
-classToSchemaNameMap['Session'] = 'session'
-schemaNameToClassMap['session'] = Session
-classToSchemaNameMap['Destination'] = 'destination'
-schemaNameToClassMap['destination'] = Destination
-classToSchemaNameMap['Producer'] = 'producer'
-schemaNameToClassMap['producer'] = Producer
-classToSchemaNameMap['Consumer'] = 'consumer'
-schemaNameToClassMap['consumer'] = Consumer
+classToSchemaNameMap['System'] = 'System'
+schemaNameToClassMap['System'] = System
+classToSchemaNameMap['Broker'] = 'Broker'
+schemaNameToClassMap['Broker'] = Broker
+classToSchemaNameMap['Agent'] = 'Agent'
+schemaNameToClassMap['Agent'] = Agent
+classToSchemaNameMap['Vhost'] = 'Vhost'
+schemaNameToClassMap['Vhost'] = Vhost
+classToSchemaNameMap['Queue'] = 'Queue'
+schemaNameToClassMap['Queue'] = Queue
+classToSchemaNameMap['Exchange'] = 'Exchange'
+schemaNameToClassMap['Exchange'] = Exchange
+classToSchemaNameMap['Binding'] = 'Binding'
+schemaNameToClassMap['Binding'] = Binding
+classToSchemaNameMap['Connection'] = 'Connection'
+schemaNameToClassMap['Connection'] = Connection
+classToSchemaNameMap['Link'] = 'Link'
+schemaNameToClassMap['Link'] = Link
+classToSchemaNameMap['Bridge'] = 'Bridge'
+schemaNameToClassMap['Bridge'] = Bridge
+classToSchemaNameMap['Session'] = 'Session'
+schemaNameToClassMap['Session'] = Session
Modified: mgmt/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/mint/python/mint/schemaparser.py 2008-06-02 16:02:23 UTC (rev 2102)
+++ mgmt/mint/python/mint/schemaparser.py 2008-06-02 16:05:18 UTC (rev 2103)
@@ -23,7 +23,7 @@
self.dataTypesMap["uuid"] = "BLOBCol"
self.dataTypesMap["uint8"] = self.dataTypesMap["hilo8"] = self.dataTypesMap["count8"] = self.dataTypesMap["mma8"] = "SmallIntCol"
self.dataTypesMap["uint16"] = self.dataTypesMap["hilo16"] = self.dataTypesMap["count16"] = self.dataTypesMap["mma16"] = "SmallIntCol"
- self.dataTypesMap["uint32"] = self.dataTypesMap["hilo32"] = self.dataTypesMap["count32"] = self.dataTypesMap["mma32"] = "IntCol"
+ self.dataTypesMap["uint32"] = self.dataTypesMap["hilo32"] = self.dataTypesMap["count32"] = self.dataTypesMap["mma32"] = self.dataTypesMap["atomic32"] = "IntCol"
self.dataTypesMap["uint64"] = self.dataTypesMap["hilo64"] = self.dataTypesMap["count64"] = self.dataTypesMap["mma64"] = self.dataTypesMap["mmaTime"] = "BigIntCol"
self.dataTypesMap["absTime"] = self.dataTypesMap["deltaTime"] = "BigIntCol"
self.dataTypesMap["bool"] = "BoolCol"
@@ -48,6 +48,8 @@
def generateForeignKeyAttrib(self, name, reference):
params = "'%s', cascade='null'" % (reference)
+ if (name == "connection"):
+ name = "clientConnection"
self.generateAttrib(name, "ForeignKey", params)
def generateHiLoAttrib(self, name, type):
@@ -72,13 +74,12 @@
def generateClassAttribs(self, schemaName, elements):
for elem in elements:
- # XXX FIX: properly handle a store ref
- if (elem["@name"] == "storeRef"):
- continue
- # XXX FIX: properly handle a store ref
+ # special handling due to name conflict with SqlObject.connection
+ if (elem["@name"] == "connection"):
+ elem["@name"] = "clientConnection"
if (elem["@type"] == "objId"):
if (elem["@name"].endswith("Ref")):
- reference = self.style.dbTableToPythonClass(elem["@name"]).replace("Ref", "")
+ reference = self.style.dbTableToPythonClass(elem["@references"])
attrib = reference[0].lower() + reference[1:]
self.generateForeignKeyAttrib(attrib, reference)
self.generateMultipleJoin(reference, self.currentClass)
@@ -115,7 +116,7 @@
self.generateAttrib("idOriginal", "BigIntCol")
self.generateTimestampAttrib("rec")
if (stats):
- self.generateForeignKeyAttrib(colPythonName, keyPythonName)
+ self.generateForeignKeyAttrib(colPythonName[0].lower() + colPythonName[1:], keyPythonName)
self.generateMultipleJoin(origPythonName, pythonName, "stats")
else:
self.generateTimestampAttrib("creation")
@@ -162,12 +163,12 @@
classes = schema.query["schema/class"]
for cls in classes:
self.startClass(cls["@name"])
- self.generateClassAttribs(cls["@name"], cls.query["configElement"])
+ self.generateClassAttribs(cls["@name"], cls.query["property"])
for elem in cls.query["method"]:
self.generateMethod(elem)
self.endClass()
self.startClass(cls["@name"], stats=True)
- self.generateClassAttribs(cls["@name"], cls.query["instElement"])
+ self.generateClassAttribs(cls["@name"], cls.query["statistic"])
self.endClass()
outputFile.write(self.pythonOutput + self.finalPythonOutput)
outputFile.close()
Modified: mgmt/mint/sql/indexes.sql
===================================================================
--- mgmt/mint/sql/indexes.sql 2008-06-02 16:02:23 UTC (rev 2102)
+++ mgmt/mint/sql/indexes.sql 2008-06-02 16:05:18 UTC (rev 2103)
@@ -1,7 +0,0 @@
-create index queue_vhost_id_idx on queue (vhost_id);
-create index exchange_vhost_id_idx on exchange (vhost_id);
-create index client_vhost_id_idx on client (vhost_id);
-
-create index queue_stats_queue_id_idx on queue_stats (queue_id);
-create index exchange_stats_exchange_id_idx on exchange_stats (exchange_id);
-create index client_stats_client_id_idx on client_stats (client_id);
Modified: mgmt/mint/sql/schema.sql
===================================================================
--- mgmt/mint/sql/schema.sql 2008-06-02 16:02:23 UTC (rev 2102)
+++ mgmt/mint/sql/schema.sql 2008-06-02 16:05:18 UTC (rev 2103)
@@ -63,7 +63,7 @@
session_id BYTEA,
label VARCHAR(1000),
registered_to BIGINT,
- sys_id BYTEA
+ system_id BYTEA
);
CREATE TABLE agent_stats (
@@ -154,7 +154,7 @@
broker_id INT
);
-CREATE TABLE client (
+CREATE TABLE connection (
id SERIAL PRIMARY KEY,
id_original BIGINT,
rec_time TIMESTAMP,
@@ -168,11 +168,11 @@
incoming BOOL
);
-CREATE TABLE client_stats (
+CREATE TABLE connection_stats (
id SERIAL PRIMARY KEY,
id_original BIGINT,
rec_time TIMESTAMP,
- client_id INT,
+ client_connection_id INT,
closing BOOL,
auth_identity VARCHAR(1000),
frames_from_client BIGINT,
@@ -181,56 +181,6 @@
bytes_to_client BIGINT
);
-CREATE TABLE consumer (
- id SERIAL PRIMARY KEY,
- id_original BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- managed_broker VARCHAR(1000),
- stats_curr_id INT,
- stats_prev_id INT,
- destination_id INT,
- queue_id INT
-);
-
-CREATE TABLE consumer_stats (
- id SERIAL PRIMARY KEY,
- id_original BIGINT,
- rec_time TIMESTAMP,
- consumer_id INT,
- msgs_consumed BIGINT,
- bytes_consumed BIGINT,
- unacked_messages INT,
- unacked_messages_low INT,
- unacked_messages_high INT
-);
-
-CREATE TABLE destination (
- id SERIAL PRIMARY KEY,
- id_original BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- managed_broker VARCHAR(1000),
- stats_curr_id INT,
- stats_prev_id INT,
- session_id INT,
- name VARCHAR(1000)
-);
-
-CREATE TABLE destination_stats (
- id SERIAL PRIMARY KEY,
- id_original BIGINT,
- rec_time TIMESTAMP,
- destination_id INT,
- flow_mode SMALLINT,
- max_msg_credits INT,
- max_byte_credits INT,
- msg_credits INT,
- byte_credits INT
-);
-
CREATE TABLE exchange (
id SERIAL PRIMARY KEY,
id_original BIGINT,
@@ -251,12 +201,12 @@
id_original BIGINT,
rec_time TIMESTAMP,
exchange_id INT,
- producers INT,
- producers_low INT,
- producers_high INT,
- bindings INT,
- bindings_low INT,
- bindings_high INT,
+ producer_count INT,
+ producer_count_low INT,
+ producer_count_high INT,
+ binding_count INT,
+ binding_count_low INT,
+ binding_count_high INT,
msg_receives BIGINT,
msg_drops BIGINT,
msg_routes BIGINT,
@@ -290,28 +240,6 @@
last_error VARCHAR(1000)
);
-CREATE TABLE producer (
- id SERIAL PRIMARY KEY,
- id_original BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- managed_broker VARCHAR(1000),
- stats_curr_id INT,
- stats_prev_id INT,
- destination_id INT,
- exchange_id INT
-);
-
-CREATE TABLE producer_stats (
- id SERIAL PRIMARY KEY,
- id_original BIGINT,
- rec_time TIMESTAMP,
- producer_id INT,
- msgs_produced BIGINT,
- bytes_produced BIGINT
-);
-
CREATE TABLE queue (
id SERIAL PRIMARY KEY,
id_original BIGINT,
@@ -341,17 +269,12 @@
msg_persist_enqueues BIGINT,
msg_persist_dequeues BIGINT,
msg_depth INT,
- msg_depth_low INT,
- msg_depth_high INT,
byte_total_enqueues BIGINT,
byte_total_dequeues BIGINT,
byte_txn_enqueues BIGINT,
byte_txn_dequeues BIGINT,
byte_persist_enqueues BIGINT,
byte_persist_dequeues BIGINT,
- byte_depth INT,
- byte_depth_low INT,
- byte_depth_high INT,
enqueue_txn_starts BIGINT,
enqueue_txn_commits BIGINT,
enqueue_txn_rejects BIGINT,
@@ -364,12 +287,12 @@
dequeue_txn_count INT,
dequeue_txn_count_low INT,
dequeue_txn_count_high INT,
- consumers INT,
- consumers_low INT,
- consumers_high INT,
- bindings INT,
- bindings_low INT,
- bindings_high INT,
+ consumer_count INT,
+ consumer_count_low INT,
+ consumer_count_high INT,
+ binding_count INT,
+ binding_count_low INT,
+ binding_count_high INT,
unacked_messages INT,
unacked_messages_low INT,
unacked_messages_high INT,
@@ -391,7 +314,7 @@
vhost_id INT,
name VARCHAR(1000),
channel_id SMALLINT,
- client_id INT,
+ client_connection_id INT,
detached_lifespan INT
);
@@ -414,7 +337,7 @@
managed_broker VARCHAR(1000),
stats_curr_id INT,
stats_prev_id INT,
- sys_id BYTEA,
+ system_id BYTEA,
os_name VARCHAR(1000),
node_name VARCHAR(1000),
release VARCHAR(1000),
@@ -493,32 +416,14 @@
ALTER TABLE broker_stats ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE SET NULL;
-ALTER TABLE client ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES client_stats (id) ON DELETE SET NULL;
+ALTER TABLE connection ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES connection_stats (id) ON DELETE SET NULL;
-ALTER TABLE client ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES client_stats (id) ON DELETE SET NULL;
+ALTER TABLE connection ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES connection_stats (id) ON DELETE SET NULL;
-ALTER TABLE client ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES vhost (id) ON DELETE SET NULL;
+ALTER TABLE connection ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES vhost (id) ON DELETE SET NULL;
-ALTER TABLE client_stats ADD CONSTRAINT client_id_exists FOREIGN KEY (client_id) REFERENCES client (id) ON DELETE SET NULL;
+ALTER TABLE connection_stats ADD CONSTRAINT client_connection_id_exists FOREIGN KEY (client_connection_id) REFERENCES connection (id) ON DELETE SET NULL;
-ALTER TABLE consumer ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES consumer_stats (id) ON DELETE SET NULL;
-
-ALTER TABLE consumer ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES consumer_stats (id) ON DELETE SET NULL;
-
-ALTER TABLE consumer ADD CONSTRAINT destination_id_exists FOREIGN KEY (destination_id) REFERENCES destination (id) ON DELETE SET NULL;
-
-ALTER TABLE consumer ADD CONSTRAINT queue_id_exists FOREIGN KEY (queue_id) REFERENCES queue (id) ON DELETE SET NULL;
-
-ALTER TABLE consumer_stats ADD CONSTRAINT consumer_id_exists FOREIGN KEY (consumer_id) REFERENCES consumer (id) ON DELETE SET NULL;
-
-ALTER TABLE destination ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES destination_stats (id) ON DELETE SET NULL;
-
-ALTER TABLE destination ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES destination_stats (id) ON DELETE SET NULL;
-
-ALTER TABLE destination ADD CONSTRAINT session_id_exists FOREIGN KEY (session_id) REFERENCES session (id) ON DELETE SET NULL;
-
-ALTER TABLE destination_stats ADD CONSTRAINT destination_id_exists FOREIGN KEY (destination_id) REFERENCES destination (id) ON DELETE SET NULL;
-
ALTER TABLE exchange ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES exchange_stats (id) ON DELETE SET NULL;
ALTER TABLE exchange ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES exchange_stats (id) ON DELETE SET NULL;
@@ -535,16 +440,6 @@
ALTER TABLE link_stats ADD CONSTRAINT link_id_exists FOREIGN KEY (link_id) REFERENCES link (id) ON DELETE SET NULL;
-ALTER TABLE producer ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES producer_stats (id) ON DELETE SET NULL;
-
-ALTER TABLE producer ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES producer_stats (id) ON DELETE SET NULL;
-
-ALTER TABLE producer ADD CONSTRAINT destination_id_exists FOREIGN KEY (destination_id) REFERENCES destination (id) ON DELETE SET NULL;
-
-ALTER TABLE producer ADD CONSTRAINT exchange_id_exists FOREIGN KEY (exchange_id) REFERENCES exchange (id) ON DELETE SET NULL;
-
-ALTER TABLE producer_stats ADD CONSTRAINT producer_id_exists FOREIGN KEY (producer_id) REFERENCES producer (id) ON DELETE SET NULL;
-
ALTER TABLE queue ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES queue_stats (id) ON DELETE SET NULL;
ALTER TABLE queue ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES queue_stats (id) ON DELETE SET NULL;
@@ -559,7 +454,7 @@
ALTER TABLE session ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES vhost (id) ON DELETE SET NULL;
-ALTER TABLE session ADD CONSTRAINT client_id_exists FOREIGN KEY (client_id) REFERENCES client (id) ON DELETE SET NULL;
+ALTER TABLE session ADD CONSTRAINT client_connection_id_exists FOREIGN KEY (client_connection_id) REFERENCES connection (id) ON DELETE SET NULL;
ALTER TABLE session_stats ADD CONSTRAINT session_id_exists FOREIGN KEY (session_id) REFERENCES session (id) ON DELETE SET NULL;
17 years, 11 months