rhmessaging commits: r2425 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-09-05 16:53:56 -0400 (Fri, 05 Sep 2008)
New Revision: 2425
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Use property title instead of name when title is present
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-09-05 20:17:04 UTC (rev 2424)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-09-05 20:53:56 UTC (rev 2425)
@@ -301,6 +301,10 @@
def render_title(self, session, item):
title = item["name"]
+ if "property" in item:
+ property = item["property"]
+ if property.title:
+ title = property.get_title(session)
return escape_amp(title)
def render_value(self, session, item):
17 years, 7 months
rhmessaging commits: r2424 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-09-05 16:17:04 -0400 (Fri, 05 Sep 2008)
New Revision: 2424
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/python/mint/schemaparser.py
Log:
pass correct 2-part object ids in method calls
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-09-05 19:16:33 UTC (rev 2423)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-09-05 20:17:04 UTC (rev 2424)
@@ -1,6 +1,7 @@
import mint
from sqlobject import *
from datetime import datetime
+from qpid.management import objectId
class System(SQLObject):
class sqlmeta:
@@ -64,14 +65,16 @@
actualArgs["clusterName"] = clusterName
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "joinCluster",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "joinCluster",
callback, args=actualArgs)
def leaveCluster(self, model, callback):
actualArgs = dict()
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "leaveCluster",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "leaveCluster",
callback, args=actualArgs)
def echo(self, model, callback, sequence, body):
@@ -81,7 +84,8 @@
actualArgs["body"] = body
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "echo",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "echo",
callback, args=actualArgs)
def connect(self, model, callback, host, port, useSsl, durable, authMechanism, username, password):
@@ -96,7 +100,8 @@
actualArgs["password"] = password
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "connect",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "connect",
callback, args=actualArgs)
class BrokerStats(SQLObject):
@@ -196,7 +201,8 @@
actualArgs["request"] = request
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "purge",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "purge",
callback, args=actualArgs)
class QueueStats(SQLObject):
@@ -340,7 +346,8 @@
actualArgs = dict()
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "close",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "close",
callback, args=actualArgs)
class ClientConnectionStats(SQLObject):
@@ -384,7 +391,8 @@
actualArgs = dict()
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "close",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "close",
callback, args=actualArgs)
def bridge(self, model, callback, durable, src, dest, key, tag, excludes, srcIsQueue, srcIsLocal):
@@ -400,7 +408,8 @@
actualArgs["srcIsLocal"] = srcIsLocal
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "bridge",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "bridge",
callback, args=actualArgs)
class LinkStats(SQLObject):
@@ -445,7 +454,8 @@
actualArgs = dict()
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "close",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "close",
callback, args=actualArgs)
class BridgeStats(SQLObject):
@@ -483,28 +493,32 @@
actualArgs = dict()
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "solicitAck",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "solicitAck",
callback, args=actualArgs)
def detach(self, model, callback):
actualArgs = dict()
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "detach",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "detach",
callback, args=actualArgs)
def resetLifespan(self, model, callback):
actualArgs = dict()
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "resetLifespan",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "resetLifespan",
callback, args=actualArgs)
def close(self, model, callback):
actualArgs = dict()
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "close",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "close",
callback, args=actualArgs)
class SessionStats(SQLObject):
@@ -580,7 +594,8 @@
actualArgs["by"] = by
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "expand",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "expand",
callback, args=actualArgs)
class JournalStats(SQLObject):
@@ -778,7 +793,8 @@
actualArgs["JobAd"] = JobAd
conn = model.connections[self.managedBroker]
classInfo = self.classInfos[self.managedBroker]
- conn.callMethod(self.idOriginal, classInfo, "GetAd",
+ originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)
+ conn.callMethod(originalId, classInfo, "GetAd",
callback, args=actualArgs)
class JobStats(SQLObject):
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-09-05 19:16:33 UTC (rev 2423)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-09-05 20:17:04 UTC (rev 2424)
@@ -162,7 +162,8 @@
self.pythonOutput += actualArgs
self.pythonOutput += " conn = model.connections[self.managedBroker]\n"
self.pythonOutput += " classInfo = self.classInfos[self.managedBroker]\n"
- self.pythonOutput += " conn.callMethod(self.idOriginal, classInfo, \"%s\",\n" % elem["@name"]
+ self.pythonOutput += " originalId = objectId(None, self.sourceScopeId, self.sourceObjectId)\n"
+ self.pythonOutput += " conn.callMethod(originalId, classInfo, \"%s\",\n" % elem["@name"]
self.pythonOutput += " callback, args=actualArgs)\n"
def endClass(self):
@@ -177,6 +178,7 @@
self.pythonOutput += "import mint\n"
self.pythonOutput += "from sqlobject import *\n"
self.pythonOutput += "from datetime import datetime\n"
+ self.pythonOutput += "from qpid.management import objectId\n"
self.finalPythonOutput += "\nclassToSchemaNameMap = dict()\n"
self.finalPythonOutput += "schemaNameToClassMap = dict()\n"
outputFile = open(self.pythonFilePath, "w")
17 years, 7 months
rhmessaging commits: r2423 - in mgmt/trunk/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-09-05 15:16:33 -0400 (Fri, 05 Sep 2008)
New Revision: 2423
Modified:
mgmt/trunk/mint/python/mint/__init__.py
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/python/mint/schemaparser.py
mgmt/trunk/mint/python/mint/update.py
mgmt/trunk/mint/sql/schema.sql
Log:
renaming sourceId fields
Modified: mgmt/trunk/mint/python/mint/__init__.py
===================================================================
--- mgmt/trunk/mint/python/mint/__init__.py 2008-09-05 18:58:27 UTC (rev 2422)
+++ mgmt/trunk/mint/python/mint/__init__.py 2008-09-05 19:16:33 UTC (rev 2423)
@@ -156,7 +156,7 @@
obj = self.objectsById[compositeId]
except KeyError:
try:
- obj = cls.selectBy(idSourceScope=id.first, idSourceObject=id.second, managedBroker=self.id)[0]
+ obj = cls.selectBy(sourceScopeId=id.first, sourceObjectId=id.second, managedBroker=self.id)[0]
self.objectsById[compositeId] = obj
except IndexError:
raise ObjectNotFound()
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-09-05 18:58:27 UTC (rev 2422)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-09-05 19:16:33 UTC (rev 2423)
@@ -7,8 +7,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -39,8 +39,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -115,8 +115,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -146,8 +146,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -174,8 +174,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -250,8 +250,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -292,8 +292,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -323,8 +323,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -365,8 +365,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -421,8 +421,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -464,8 +464,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -526,8 +526,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -556,8 +556,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -626,8 +626,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -741,8 +741,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -797,8 +797,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -846,8 +846,8 @@
lazyUpdate = True
recTime = TimestampCol(default=None)
- idSourceScope = BigIntCol(default=None)
- idSourceObject = BigIntCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-09-05 18:58:27 UTC (rev 2422)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-09-05 19:16:33 UTC (rev 2423)
@@ -132,8 +132,8 @@
self.generateForeignKeyAttrib(colPythonName[0].lower() + colPythonName[1:], keyPythonName)
self.generateMultipleJoin(origPythonName, pythonName, "stats")
else:
- self.generateAttrib("idSourceScope", "BigIntCol")
- self.generateAttrib("idSourceObject", "BigIntCol")
+ self.generateAttrib("sourceScopeId", "BigIntCol")
+ self.generateAttrib("sourceObjectId", "BigIntCol")
self.generateTimestampAttrib("creation")
self.generateTimestampAttrib("deletion")
self.generateAttrib("managedBroker", "StringCol", "length=1000")
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-09-05 18:58:27 UTC (rev 2422)
+++ mgmt/trunk/mint/python/mint/update.py 2008-09-05 19:16:33 UTC (rev 2423)
@@ -70,8 +70,8 @@
if "id" in attrs:
id = attrs.pop("id")
if (not cls.__name__.endswith("Stats")):
- attrs["idSourceScope"] = id.first
- attrs["idSourceObject"] = id.second
+ attrs["sourceScopeId"] = id.first
+ attrs["sourceObjectId"] = id.second
if "connectionRef" in attrs:
attrs["clientConnectionRef"] = attrs.pop("connectionRef")
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2008-09-05 18:58:27 UTC (rev 2422)
+++ mgmt/trunk/mint/sql/schema.sql 2008-09-05 19:16:33 UTC (rev 2423)
@@ -59,8 +59,8 @@
CREATE TABLE agent (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -82,8 +82,8 @@
CREATE TABLE binding (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -105,8 +105,8 @@
CREATE TABLE bridge (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -133,8 +133,8 @@
CREATE TABLE broker (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -162,8 +162,8 @@
CREATE TABLE client_connection (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -189,8 +189,8 @@
CREATE TABLE exchange (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -223,8 +223,8 @@
CREATE TABLE job (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -263,8 +263,8 @@
CREATE TABLE journal (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -316,8 +316,8 @@
CREATE TABLE link (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -341,8 +341,8 @@
CREATE TABLE queue (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -400,8 +400,8 @@
CREATE TABLE scheduler (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -439,8 +439,8 @@
CREATE TABLE session (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -465,8 +465,8 @@
CREATE TABLE slot (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -570,8 +570,8 @@
CREATE TABLE store (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -592,8 +592,8 @@
CREATE TABLE submitter (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -618,8 +618,8 @@
CREATE TABLE system (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -642,8 +642,8 @@
CREATE TABLE vhost (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
- id_source_scope BIGINT,
- id_source_object BIGINT,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
17 years, 7 months
rhmessaging commits: r2422 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-09-05 14:58:27 -0400 (Fri, 05 Sep 2008)
New Revision: 2422
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
A quick fix for the job view failure
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-09-05 17:13:53 UTC (rev 2421)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-09-05 18:58:27 UTC (rev 2422)
@@ -1600,7 +1600,7 @@
return "Job"
def get_object_name(self, job):
- return str(job.idOriginal)
+ return str(job.idSourceObject)
def show_object(self, session, job):
17 years, 7 months
rhmessaging commits: r2421 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-09-05 13:13:53 -0400 (Fri, 05 Sep 2008)
New Revision: 2421
Modified:
mgmt/trunk/cumin/python/cumin/job.py
mgmt/trunk/cumin/python/cumin/job.strings
mgmt/trunk/cumin/python/cumin/model.py
Log:
First cut a property groups
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-09-05 17:13:20 UTC (rev 2420)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-09-05 17:13:53 UTC (rev 2421)
@@ -182,7 +182,7 @@
self.__remove = JobRemove(app, "jobRemove")
self.add_mode(self.__remove)
- self.__edit_ads = JobEditAds(app, "editads")
+ self.__edit_ads = JobAdsEditor(app, "editads")
self.add_mode(self.__edit_ads)
self.__scheduler = SchedulerFrame(app, "scheduler")
@@ -297,34 +297,30 @@
self.add_child(self.__tabs)
#self.__tabs.add_tab(JobStats(app, "stats"))
- self.__tabs.add_tab(JobAds(app, "jobads"))
+ self.__tabs.add_tab(JobAdsViewer(app, "jobads"))
self.__tabs.add_tab(JobOutput(app, "output"))
self.__tabs.add_tab(SystemSet(app, "systems"))
self.__tabs.add_tab(CuminDetails(app, "details"))
-class JobAds(Widget):
- def __init__(self, app, name):
- super(JobAds, self).__init__(app, name)
- props = JobAdsViewer(app, "properties")
- self.add_child(props)
-
- def get_args(self, session):
- return self.frame.get_args(session)
-
- def render_title(self, session, job):
- return "Ad"
-
class JobAdsSet(PropertySet):
def __init__(self, app, name):
super(JobAdsSet, self).__init__(app, name, )
# self.got_data = False
- self.item_renderer = JobPropertyRenderer(self, "ad_html")
def get_args(self, session):
return self.frame.get_args(session)
def do_get_items(self, session, job):
+ items = self.items.get(session)
+ if not items:
+ items = self.gen_items(session, job)
+ # cache the items
+ self.items.set(session, items)
+
+ return items
+
+ def gen_items(self, session, job):
# def completion(status, args=None):
# self.got_data = True
@@ -414,41 +410,14 @@
u'Out': u'/dev/null'}
cls = self.app.model.get_class_by_object(job)
- keys = ads.keys()
- keys.sort()
- return [[x, ads[x], cls] for x in keys]
-class JobEditAds(CuminForm, JobAdsSet):
- def __init__(self, app, name):
- super(JobEditAds, self).__init__(app, name)
+ # list of dictionaries
+ # each disctionary has:
+ # name:, value:, type: [, error:] [, property:] [,path:]
+ return [self.gen_item(x, ads[x], cls) for x in ads]
- # the parameter that will hold all the field values
- self.ads = DictParameter(app, "params")
- self.add_parameter(self.ads)
- self.add_form_parameter(self.ads)
-
- self.item_renderer = EditablePropertyRenderer(self, "property_html")
-
- def get_args(self, session):
- return self.frame.get_args(session)
-
- def render_title(self, session, job):
- return "Ad"
-
- def do_get_items(self, session, job):
- cls = self.app.model.get_class_by_object(job)
- ads = self.ads.get(session)
- if len(ads):
- keys = ads.keys()
- keys.sort()
- return [self.gen_item(x, ads[x]["value"], cls, dtype=ads[x]["type"], error=ads[x]) for x in keys]
- else:
- items = super(JobEditAds,self).do_get_items(session, job)
- return [self.gen_item(x[0], x[1], cls) for x in items]
-
- def gen_item(self, name, value, cls, dtype=None, error=None):
+ def gen_item(self, name, value, cls, path=None, dtype=None, error=None):
idict = dict()
- ilist = list()
idict["name"] = name
idict["value"] = value
if dtype:
@@ -465,13 +434,122 @@
if name in cls.ad_properties_by_name:
idict["property"] = cls.ad_properties_by_name[name]
- ilist.append(idict)
- ilist.append(self.ads.path)
- return ilist
+ if path:
+ idict["path"] = path
+ return idict
def get_type(self, value):
return isinstance(value, int) and "number" or "string"
+class JobPropertyRenderer(TemplateRenderer):
+ def render_title(self, session, item):
+ title = item["name"]
+ if "property" in item:
+ property = item["property"]
+ if property.title:
+ title = property.get_title(session)
+ return escape_amp(title)
+
+ def render_value(self, session, item):
+ value = item["value"]
+ if "property" in item:
+ property = item["property"]
+ if property.renderer:
+ value = property.renderer(session, value)
+ return escape_amp(value)
+
+ def render_inline_help(self, session, item):
+ if "property" in item:
+ property = item["property"]
+ return property.description
+
+class JobAdsViewer(JobAdsSet):
+ def __init__(self, app, name):
+ super(JobAdsViewer, self).__init__(app, name)
+
+ self.group_tmpl = Template(self, "group_html")
+ self.item_renderer = JobPropertyRenderer(self, "property_html")
+
+ def get_args(self, session):
+ return self.frame.get_args(session)
+
+ def render_title(self, session, job):
+ return "Properties"
+
+ def do_get_items(self, session, args):
+ job = args[0]
+ group = args[1]
+ all_items = super(JobAdsViewer, self).do_get_items(session, job)
+ group_items = list()
+ for item in all_items:
+ if "property" in item:
+ property = item["property"]
+ item_group = property.group
+ else:
+ item_group = "Other"
+ if item_group == group:
+ group_items.append(item)
+
+ return group_items
+
+ def render_properties(self, session, *args):
+ items = self.do_get_items(session, *args)
+ writer = Writer()
+
+ for item in items:
+ self.item_renderer.render(writer, session, item)
+
+ return writer.to_string()
+
+ def render_edit_ads_url(self, session, job):
+ branch = session.branch()
+ self.frame.show_ads_edit(branch)
+ return branch.marshal()
+
+ def render_groups(self, session, job):
+ groups = self.app.model.get_ad_groups()
+ writer = Writer()
+ for group in groups:
+ self.group_tmpl.render(writer, session, (job, group,))
+ return writer.to_string()
+
+ def render_group_name(self, session, args):
+ return args[1]
+
+class JobAdsEditor(CuminForm, JobAdsViewer):
+ def __init__(self, app, name):
+ super(JobAdsEditor, self).__init__(app, name)
+
+ # the parameter that will hold all the field values
+ self.ads = DictParameter(app, "params")
+ self.add_parameter(self.ads)
+ self.add_form_parameter(self.ads)
+
+ self.item_renderer = EditablePropertyRenderer(self, "property_html")
+
+ def do_get_items(self, session, args):
+ job = args[0]
+ group = args[1]
+ cls = self.app.model.get_class_by_object(job)
+ ads = self.ads.get(session)
+ if len(ads):
+ return [self.gen_item(x, ads[x]["value"], cls, path=self.ads.path,
+ dtype=ads[x]["type"], error=ads[x]) for x in ads
+ if self.is_group(x, cls, group)]
+ else:
+ items = super(JobAdsEditor, self).do_get_items(session, args)
+ for item in items:
+ item["path"] = self.ads.path
+ return items
+
+ def is_group(self, name, cls, group):
+ if name in cls.ad_properties_by_name:
+ property = cls.ad_properties_by_name[name]
+ item_group = property.group
+ else:
+ item_group = "Other"
+ return item_group == group
+
def process_submit(self, session, job):
ads = self.ads.get(session)
errors = False
@@ -498,50 +576,6 @@
action.invoke(job, just_ads)
self.process_cancel(session, job)
- def process_cancel(self, session, job):
- self.ads.clear()
- super(JobEditAds, self).process_cancel(session, job)
-
-class JobPropertyRenderer(TemplateRenderer):
- def render_ad_title(self, session, prop):
- return escape_amp(prop[0])
-
- def render_ad_value(self, session, prop):
- name, value, props = self.decode_props(prop)
- if props and props.renderer:
- value = props.renderer(session, value)
- return escape_amp(value)
-
- def render_ad_help(self, session, prop):
- name, value, props = self.decode_props(prop)
- if props and props.description:
- return props.description
-
- def decode_props(self, prop):
- name = prop[0]
- value = prop[1]
- cls = prop[2]
- if name in cls.ad_properties_by_name:
- props = cls.ad_properties_by_name[name]
- else:
- props = None
- return name, value, props
-
-class JobAdsViewer(JobAdsSet):
- def __init__(self, app, name):
- super(JobAdsViewer, self).__init__(app, name)
-
- def get_args(self, session):
- return self.frame.get_args(session)
-
- def do_get_items(self, session, job):
- return super(JobAdsViewer, self).do_get_items(session, job)
-
- def render_edit_ads_url(self, session, job):
- branch = session.branch()
- self.frame.show_ads_edit(branch)
- return branch.marshal()
-
class JobOutput(TabbedModeSet):
def __init__(self, app, name):
super(JobOutput, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.strings 2008-09-05 17:13:20 UTC (rev 2420)
+++ mgmt/trunk/cumin/python/cumin/job.strings 2008-09-05 17:13:53 UTC (rev 2421)
@@ -111,39 +111,46 @@
[JobAdsViewer.html]
<ul class="actions">
- <li><a class="nav" href="{edit_ads_url}">Edit Job Ad</a></li>
+ <li><a class="nav" href="{edit_ads_url}">Edit Properties</a></li>
</ul>
<table class="CuminDetails">
<tbody>
<tr>
<td>
- <h2>Ad</h2>
- <table class="PropertySet">
- <thead>
- <tr>
- <th style="width: 33%;">Name</th>
- <th style="width: 33%;">Value</th>
- <th style="width: 33%;"> </th>
- </tr>
- </thead>
- <tbody>{items}</tbody>
- </table>
+ <h2>Properties</h2>
+ {groups}
</td>
</tr>
</tbody>
</table>
<ul class="actions">
- <li><a class="nav" href="{edit_ads_url}">Edit Job Ad</a></li>
+ <li><a class="nav" href="{edit_ads_url}">Edit Properties</a></li>
</ul>
-[JobAdsViewer.ad_html]
+[JobAdsViewer.group_html]
+<div class="sactions">
+ <h2>{group_name}</h2>
+</div>
+<table class="PropertySet">
+ <thead>
+ <tr>
+ <th style="width: 33%;">Name</th>
+ <th style="width: 33%;">Value</th>
+ <th style="width: 33%;"> </th>
+ </tr>
+ </thead>
+ <tbody>
+ {properties}
+ </tbody>
+</table>
+
+
+[JobAdsViewer.property_html]
<tr>
- <th>{ad_title}</th><td>{ad_value}</td><td>{ad_help}</td>
+ <th>{title}</th><td>{value}</td><td>{inline_help}</td>
</tr>
-
-
-[JobEditAds.css]
+[JobAdsEditor.css]
div.inline_help {
float: right;
}
@@ -152,29 +159,20 @@
display: inline;
}
-[JobEditAds.html]
+[JobAdsEditor.html]
<form id="{id}" class="mform editform" method="post" action="?">
<div class="inline_help">
<h2>Legend</h2>
- <span class="edit_string">String input expected</span>
<span class="edit_number">Numeric input expected</span>
+ <span class="edit_string">String input expected</span>
</div>
{help} {submit} {cancel}
-<table class="CuminDetails">
+<table class="CuminDetails Editable">
<tbody>
<tr>
<td>
- <h2>Edit Job Ad</h2>
- <table class="PropertySet Editable">
- <thead>
- <tr>
- <th style="width: 33%;">Name</th>
- <th style="width: 33%;">Value</th>
- <th style="width: 33%;"> </th>
- </tr>
- </thead>
- <tbody>{items}</tbody>
- </table>
+ <h2>Properties</h2>
+ {groups}
</td>
</tr>
</tbody>
@@ -183,7 +181,4 @@
<div>{hidden_inputs}</div>
</form>
-[JobEditAds.property_html]
-<tr>
- <th>{title}</th><td>{value}</td><td>{inline_help}</td>
-</tr>
+
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-09-05 17:13:20 UTC (rev 2420)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-09-05 17:13:53 UTC (rev 2421)
@@ -67,6 +67,9 @@
self.classes.append(cls)
setattr(self, cls.cumin_name, cls)
+ def get_ad_groups(self):
+ return AdProperty.get_ad_groups()
+
def get_class_by_object(self, mint_object):
for cls in self.classes:
if cls.mint_class is mint_object.__class__:
@@ -102,18 +105,32 @@
return self.app.main_page.show_main(session)
class AdProperty(object):
+ groups = ["Main", "Condor Info", "Command Info", "Other"]
+
def __init__(self, cls, name):
self.cumin_model = cls.cumin_model
self.cumin_class = cls
self.description = None
self.example = None
+ self.group = "Main"
self.name = name
self.renderer = None
+ self.title = None
self.writable = True
self.cumin_class.add_ad_property(self)
+ def get_title(self, session):
+ if self.title:
+ return self.title
+ else:
+ return self.name
+
+ @classmethod
+ def get_ad_groups(cls):
+ return cls.groups
+
class CuminProperty(object):
def __init__(self, cls, name):
self.cumin_model = cls.cumin_model
@@ -368,10 +385,6 @@
self.ad_properties.append(prop)
self.ad_properties_by_name[prop.name] = prop
- def add_ad_property(self, prop):
- self.ad_properties.append(prop)
- self.ad_properties_by_name[prop.name] = prop
-
def add_stat(self, stat):
self.stats.append(stat)
setattr(self, stat.name, stat)
@@ -1462,30 +1475,57 @@
def __init__(self, model):
super(CuminJob, self).__init__(model, "job", Job, JobStats)
- prop = CuminProperty(self, "AccountingGroup")
- prop.title = "Group"
- prop.summary = True
+ ### Main Group
+ prop = self.JobStatusProperty(self, "JobStatus")
+ prop.description = "The current job status"
+ prop.renderer = prop.render_status
+ prop.title = "Job Status"
+ prop.writable = False
+ prop = AdProperty(self, "Owner")
+ prop.writable = False
+
+ prop = AdProperty(self, "BufferBlockSize")
+ prop.example = "32768"
+
+ ### Condor Info Group
prop = AdProperty(self, "CondorVersion")
+ prop.group = "Condor Info"
prop.writable = False
prop = AdProperty(self, "CondorPlatform")
+ prop.group = "Condor Info"
prop.writable = False
- prop = AdProperty(self, "Owner")
- prop.writable = False
-
+ ### Command Info Group
prop = AdProperty(self, "Args")
prop.description = "Arguments passed to job Cmd"
+ prop.group = "Command Info"
- prop = AdProperty(self, "BufferBlockSize")
- prop.example = "<span class=\"prop_example\">32768</span>"
+ prop = AdProperty(self, "Cmd")
+ prop.description = "Command that will run the job"
+ prop.group = "Command Info"
+ prop.title = "Command"
- prop = self.JobStatusProperty(self, "JobStatus")
- prop.writable = False
- prop.renderer = prop.render_status
- prop.description = "The current job status"
+ prop = AdProperty(self, "In")
+ prop.description = "Command Input"
+ prop.group = "Command Info"
+ prop = AdProperty(self, "Iwd")
+ prop.description = "Command Input Working Directory"
+ prop.group = "Command Info"
+ prop.title = "Working Directory"
+
+ prop = AdProperty(self, "Out")
+ prop.description = "Where the output will be stored"
+ prop.example = "'/dev/null' or '~/logs/'"
+ prop.group = "Command Info"
+
+ ######## Properties
+ prop = CuminProperty(self, "AccountingGroup")
+ prop.summary = True
+ prop.title = "Group"
+
prop = self.SchedulerProperty(self, "scheduler")
prop.title = "Scheduler"
prop.summary = True
@@ -1543,6 +1583,7 @@
prop = CuminProperty(self, "HoldReason")
prop.title = "Hold Reason"
+ ######## Actions
action = self.Hold(self, "hold")
action.summary = True
@@ -1553,6 +1594,7 @@
action.summary = True
action = self.SaveAd(self, "savead")
+ action.navigable = False
def get_title(self, session):
return "Job"
@@ -1587,11 +1629,17 @@
class SchedulerProperty(CuminProperty):
def value(self, session, job):
- scheduler = job.scheduler
branch = session.branch()
frame = self.cumin_class.get_pool_frame(branch)
- frame.show_scheduler(branch, scheduler)
- return scheduler and escape_amp(fmt_olink(branch, scheduler, name=scheduler.Name))
+ try:
+ scheduler = job.scheduler
+ frame.show_scheduler(branch, scheduler)
+ except:
+ scheduler = job
+ scheduler.Name = "Unavailable"
+ frame.show_job(branch, job)
+
+ return escape_amp(fmt_olink(branch, scheduler, name=scheduler.Name))
class Hold(CuminAction):
def show(self, session, job):
@@ -1627,6 +1675,9 @@
job.remove(self.cumin_model.data, completion)
class SaveAd(CuminAction):
+ def show(self, session, job):
+ pass
+
def get_title(self, session):
return "Save Ad for"
17 years, 7 months
rhmessaging commits: r2420 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-09-05 13:13:20 -0400 (Fri, 05 Sep 2008)
New Revision: 2420
Modified:
mgmt/trunk/cumin/python/cumin/widgets.py
Log:
Changed argument passed to EditableProperty class to a single dictionary item
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-09-05 15:45:46 UTC (rev 2419)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-09-05 17:13:20 UTC (rev 2420)
@@ -282,15 +282,13 @@
"""Display input fields for editing properties
Parent class needs to override do_get_items() and return a list of items.
- Each item should be another list.
- item[0] should be the a dict:
- item[0]["name"] is required and should be the display label
- item[0]["value"] is required and should be the value to edit
- item[0]["type"] is required and should be an input type <"number" | "string">
- item[0]["error"] is optional and should be the error text to display for that item
- item[0]["help"] is optional help to be displayed for the item
- item[0]["writable"] is optional and assumed to be True if missing
- item[1] should be a the path that will be prepended to the file names
+ Each item should be a dictionary.
+ ["name"] is required and should be the display label
+ ["value"] is required and should be the value to edit
+ ["type"] is required and should be an input type <"number" | "string">
+ ["path"] is required and should be the DictParameter path to prepend to the name
+ ["error"] is optional and should be the error text to display for that item
+ ["property"] is optional and should be a dictionary of item properties
"""
def __init__(self, widget, template_key):
super(EditablePropertyRenderer, self).__init__(widget, template_key)
@@ -301,53 +299,53 @@
self.__number_template = Template(self, "number_html")
self.__readonly_template = Template(self, "readonly_html")
- def render_title(self, session, propval):
- title = propval[0]["name"]
+ def render_title(self, session, item):
+ title = item["name"]
return escape_amp(title)
- def render_value(self, session, propval):
- value = propval[0]["value"]
- type = propval[0]["type"]
+ def render_value(self, session, item):
+ value = item["value"]
+ type = item["type"]
writable = True
- property = "property" in propval[0] and propval[0]["property"] or None
+ property = "property" in item and item["property"] or None
if property:
writable = property.writable
writer = Writer()
if not writable:
- self.__readonly_template.render(writer, session, propval)
+ self.__readonly_template.render(writer, session, item)
elif type == "number":
- self.__number_template.render(writer, session, propval)
+ self.__number_template.render(writer, session, item)
else:
uvalue = value.upper()
if uvalue == "FALSE" or uvalue == "TRUE":
- self.__bool_template.render(writer, session, propval)
+ self.__bool_template.render(writer, session, item)
else:
if len(value) > 40:
- self.__bigstring_template.render(writer, session, propval)
+ self.__bigstring_template.render(writer, session, item)
else:
- self.__string_template.render(writer, session, propval)
+ self.__string_template.render(writer, session, item)
return writer.to_string()
- def render_pname(self, session, propval):
+ def render_pname(self, session, item):
return DictParameter.sep().join(
- (propval[1], escape_entity(propval[0]["name"]), "value"))
+ (item["path"], escape_entity(item["name"]), "value"))
- def render_ptype_name(self, session, propval):
+ def render_ptype_name(self, session, item):
return DictParameter.sep().join(
- (propval[1], escape_entity(propval[0]["name"]), "type"))
+ (item["path"], escape_entity(item["name"]), "type"))
- def render_ptype_value(self, session, propval):
- return propval[0]["type"]
+ def render_ptype_value(self, session, item):
+ return item["type"]
- def render_val(self, session, propval):
- value = self.get_val(session, propval)
+ def render_val(self, session, item):
+ value = self.get_val(session, item)
return escape_entity(str(value))
- def render_display_val(self, session, propval):
- value = self.get_val(session, propval)
- property = "property" in propval[0] and propval[0]["property"] or None
+ def render_display_val(self, session, item):
+ value = self.get_val(session, item)
+ property = "property" in item and item["property"] or None
if property:
renderer = property.renderer
if renderer:
@@ -355,32 +353,35 @@
return escape_amp(str(value))
- def get_val(self, session, propval):
+ def get_val(self, session, item):
try:
- value = propval[0]["value"]
+ value = item["value"]
except KeyError:
value = ""
return value
- def render_error(self, session, propval):
- if "error" in propval[0]:
- return "<div class=\"error\">%s</div>" % propval[0]["error"]
+ def render_error(self, session, item):
+ if "error" in item:
+ return "<div class=\"error\">%s</div>" % item["error"]
- def render_inline_help(self, session, propval):
- property = "property" in propval[0] and propval[0]["property"] or None
+ def render_inline_help(self, session, item):
+ property = "property" in item and item["property"] or None
if property:
- example = property.example or ""
+ if property.example:
+ example = "<span class=\"prop_example\">%s</span>" % property.example
+ else:
+ example = ""
description = property.description or ""
- return " ".join((example, description))
+ return " ".join((description, example))
- def render_false_selected(self, session, propval):
- return propval[0]["value"].upper() == "FALSE" and "checked=\"checked\"" or ""
+ def render_false_selected(self, session, item):
+ return item["value"].upper() == "FALSE" and "checked=\"checked\"" or ""
- def render_true_selected(self, session, propval):
- return propval[0]["value"].upper() == "TRUE" and "checked=\"checked\"" or ""
+ def render_true_selected(self, session, item):
+ return item["value"].upper() == "TRUE" and "checked=\"checked\"" or ""
- def render_edit_number_class(self, session, propval):
- return "error" in propval[0] and "numeric_error" or "edit_number"
+ def render_edit_number_class(self, session, item):
+ return "error" in item and "numeric_error" or "edit_number"
class CuminProperties(PropertySet):
def get_args(self, session):
17 years, 7 months
rhmessaging commits: r2419 - in mgmt/trunk/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-09-05 11:45:46 -0400 (Fri, 05 Sep 2008)
New Revision: 2419
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/sql/schema.sql
Log:
handle 2-part id, rebuilt schema
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-09-05 15:44:05 UTC (rev 2418)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-09-05 15:45:46 UTC (rev 2419)
@@ -6,8 +6,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -26,7 +27,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
system = ForeignKey('System', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -38,8 +38,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -102,7 +103,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
broker = ForeignKey('Broker', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -114,8 +114,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -124,7 +125,7 @@
classInfos = dict() # brokerId => classInfo
clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
label = StringCol(length=1000, default=None)
- registeredTo = BigIntCol(default=None)
+ broker = ForeignKey('Broker', cascade='null', default=None)
systemId = BLOBCol(default=None)
objectIdBank = IntCol(default=None)
@@ -133,7 +134,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
agent = ForeignKey('Agent', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -145,8 +145,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -161,7 +162,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -173,8 +173,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -202,7 +203,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
queue = ForeignKey('Queue', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -249,8 +249,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -267,7 +268,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
exchange = ForeignKey('Exchange', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -291,8 +291,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -309,7 +310,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
binding = ForeignKey('Binding', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -322,8 +322,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -346,7 +347,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -364,8 +364,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -406,7 +407,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
link = ForeignKey('Link', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -420,8 +420,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -451,7 +452,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
bridge = ForeignKey('Bridge', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -463,8 +463,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -510,7 +511,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
session = ForeignKey('Session', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -525,8 +525,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -537,32 +538,15 @@
location = StringCol(length=1000, default=None)
defaultInitialFileCount = SmallIntCol(default=None)
defaultDataFileSize = IntCol(default=None)
- tplIsInitialized = BoolCol(default=None)
- tplDirectory = StringCol(length=1000, default=None)
- tplWritePageSize = IntCol(default=None)
- tplWritePages = IntCol(default=None)
- tplInitialFileCount = SmallIntCol(default=None)
- tplDataFileSize = IntCol(default=None)
- tplCurrentFileCount = IntCol(default=None)
class StoreStats(SQLObject):
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
store = ForeignKey('Store', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
- tplTransactionDepth = IntCol(default=None)
- tplTransactionDepthLow = IntCol(default=None)
- tplTransactionDepthHigh = IntCol(default=None)
- tplTxnPrepares = BigIntCol(default=None)
- tplTxnCommits = BigIntCol(default=None)
- tplTxnAborts = BigIntCol(default=None)
- tplOutstandingAIOs = IntCol(default=None)
- tplOutstandingAIOsLow = IntCol(default=None)
- tplOutstandingAIOsHigh = IntCol(default=None)
@@ -571,25 +555,23 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
statsCurr = ForeignKey('JournalStats', cascade='null', default=None)
statsPrev = ForeignKey('JournalStats', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
- queue = ForeignKey('Queue', cascade='null', default=None)
name = StringCol(length=1000, default=None)
+ queue = ForeignKey('Queue', cascade='null', default=None)
directory = StringCol(length=1000, default=None)
baseFileName = StringCol(length=1000, default=None)
writePageSize = IntCol(default=None)
writePages = IntCol(default=None)
readPageSize = IntCol(default=None)
readPages = IntCol(default=None)
- initialFileCount = SmallIntCol(default=None)
- dataFileSize = IntCol(default=None)
- currentFileCount = IntCol(default=None)
def expand(self, model, callback, by):
@@ -605,19 +587,17 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
journal = ForeignKey('Journal', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
+ initialFileCount = SmallIntCol(default=None)
+ dataFileSize = IntCol(default=None)
+ currentFileCount = IntCol(default=None)
recordDepth = IntCol(default=None)
recordDepthLow = IntCol(default=None)
recordDepthHigh = IntCol(default=None)
- enqueues = BigIntCol(default=None)
- dequeues = BigIntCol(default=None)
- txnEnqueues = BigIntCol(default=None)
- txnDequeues = BigIntCol(default=None)
- txnCommits = BigIntCol(default=None)
- txnAborts = BigIntCol(default=None)
+ recordEnqueues = BigIntCol(default=None)
+ recordDequeues = BigIntCol(default=None)
outstandingAIOs = IntCol(default=None)
outstandingAIOsLow = IntCol(default=None)
outstandingAIOsHigh = IntCol(default=None)
@@ -645,8 +625,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -709,7 +690,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
slot = ForeignKey('Slot', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -760,8 +740,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -804,7 +785,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
job = ForeignKey('Job', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -816,8 +796,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -840,7 +821,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
scheduler = ForeignKey('Scheduler', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -865,8 +845,9 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
+ idSourceScope = BigIntCol(default=None)
+ idSourceObject = BigIntCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
@@ -884,7 +865,6 @@
class sqlmeta:
lazyUpdate = True
- idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
submitter = ForeignKey('Submitter', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -915,7 +895,9 @@
ClientConnection.sqlmeta.addJoin(SQLMultipleJoin('Agent', joinMethodName='agents'))
+Broker.sqlmeta.addJoin(SQLMultipleJoin('Agent', joinMethodName='agents'))
+
Agent.sqlmeta.addJoin(SQLMultipleJoin('AgentStats', joinMethodName='stats'))
classToSchemaNameMap['Vhost'] = 'Vhost'
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2008-09-05 15:44:05 UTC (rev 2418)
+++ mgmt/trunk/mint/sql/schema.sql 2008-09-05 15:45:46 UTC (rev 2419)
@@ -58,8 +58,9 @@
CREATE TABLE agent (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -67,22 +68,22 @@
stats_prev_id INT,
client_connection_id INT,
label VARCHAR(1000),
- registered_to BIGINT,
+ broker_id INT,
system_id BYTEA,
object_id_bank INT
);
CREATE TABLE agent_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
agent_id INT
);
CREATE TABLE binding (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -96,7 +97,6 @@
CREATE TABLE binding_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
binding_id INT,
msg_matched BIGINT
@@ -104,8 +104,9 @@
CREATE TABLE bridge (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -125,15 +126,15 @@
CREATE TABLE bridge_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
bridge_id INT
);
CREATE TABLE broker (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -154,15 +155,15 @@
CREATE TABLE broker_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
broker_id INT
);
CREATE TABLE client_connection (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -175,7 +176,6 @@
CREATE TABLE client_connection_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
client_connection_id INT,
closing BOOL,
@@ -188,8 +188,9 @@
CREATE TABLE exchange (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -203,7 +204,6 @@
CREATE TABLE exchange_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
exchange_id INT,
producer_count INT,
@@ -222,8 +222,9 @@
CREATE TABLE job (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -255,47 +256,42 @@
CREATE TABLE job_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
job_id INT
);
CREATE TABLE journal (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
stats_curr_id INT,
stats_prev_id INT,
- queue_id INT,
name VARCHAR(1000),
+ queue_id INT,
directory VARCHAR(1000),
base_file_name VARCHAR(1000),
write_page_size INT,
write_pages INT,
read_page_size INT,
- read_pages INT,
- initial_file_count SMALLINT,
- data_file_size INT,
- current_file_count INT
+ read_pages INT
);
CREATE TABLE journal_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
journal_id INT,
+ initial_file_count SMALLINT,
+ data_file_size INT,
+ current_file_count INT,
record_depth INT,
record_depth_low INT,
record_depth_high INT,
- enqueues BIGINT,
- dequeues BIGINT,
- txn_enqueues BIGINT,
- txn_dequeues BIGINT,
- txn_commits BIGINT,
- txn_aborts BIGINT,
+ record_enqueues BIGINT,
+ record_dequeues BIGINT,
outstanding_ai_os INT,
outstanding_ai_os_low INT,
outstanding_ai_os_high INT,
@@ -319,8 +315,9 @@
CREATE TABLE link (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -335,7 +332,6 @@
CREATE TABLE link_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
link_id INT,
state VARCHAR(1000),
@@ -344,8 +340,9 @@
CREATE TABLE queue (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -361,7 +358,6 @@
CREATE TABLE queue_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
queue_id INT,
msg_total_enqueues BIGINT,
@@ -403,8 +399,9 @@
CREATE TABLE scheduler (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -423,7 +420,6 @@
CREATE TABLE scheduler_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
scheduler_id INT,
num_users INT,
@@ -442,8 +438,9 @@
CREATE TABLE session (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -458,7 +455,6 @@
CREATE TABLE session_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
session_id INT,
attached BOOL,
@@ -468,8 +464,9 @@
CREATE TABLE slot (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -528,7 +525,6 @@
CREATE TABLE slot_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
slot_id INT,
activity VARCHAR(1000),
@@ -573,8 +569,9 @@
CREATE TABLE store (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -583,36 +580,20 @@
broker_id INT,
location VARCHAR(1000),
default_initial_file_count SMALLINT,
- default_data_file_size INT,
- tpl_is_initialized BOOL,
- tpl_directory VARCHAR(1000),
- tpl_write_page_size INT,
- tpl_write_pages INT,
- tpl_initial_file_count SMALLINT,
- tpl_data_file_size INT,
- tpl_current_file_count INT
+ default_data_file_size INT
);
CREATE TABLE store_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
- store_id INT,
- tpl_transaction_depth INT,
- tpl_transaction_depth_low INT,
- tpl_transaction_depth_high INT,
- tpl_txn_prepares BIGINT,
- tpl_txn_commits BIGINT,
- tpl_txn_aborts BIGINT,
- tpl_outstanding_ai_os INT,
- tpl_outstanding_ai_os_low INT,
- tpl_outstanding_ai_os_high INT
+ store_id INT
);
CREATE TABLE submitter (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -627,7 +608,6 @@
CREATE TABLE submitter_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
submitter_id INT,
held_jobs INT,
@@ -637,8 +617,9 @@
CREATE TABLE system (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -654,15 +635,15 @@
CREATE TABLE system_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
system_id INT
);
CREATE TABLE vhost (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
+ id_source_scope BIGINT,
+ id_source_object BIGINT,
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
@@ -674,7 +655,6 @@
CREATE TABLE vhost_stats (
id SERIAL PRIMARY KEY,
- id_original BIGINT,
rec_time TIMESTAMP,
vhost_id INT
);
@@ -695,6 +675,8 @@
ALTER TABLE agent ADD CONSTRAINT client_connection_id_exists FOREIGN KEY (client_connection_id) REFERENCES client_connection (id) ON DELETE SET NULL;
+ALTER TABLE agent ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id) REFERENCES broker (id) ON DELETE SET NULL;
+
ALTER TABLE agent_stats ADD CONSTRAINT agent_id_exists FOREIGN KEY (agent_id) REFERENCES agent (id) ON DELETE SET NULL;
ALTER TABLE binding ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES binding_stats (id) ON DELETE SET NULL;
17 years, 7 months
rhmessaging commits: r2418 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-09-05 11:44:05 -0400 (Fri, 05 Sep 2008)
New Revision: 2418
Modified:
mgmt/trunk/mint/python/mint/__init__.py
mgmt/trunk/mint/python/mint/schemaparser.py
mgmt/trunk/mint/python/mint/update.py
Log:
handle 2-part id
Modified: mgmt/trunk/mint/python/mint/__init__.py
===================================================================
--- mgmt/trunk/mint/python/mint/__init__.py 2008-09-05 15:00:30 UTC (rev 2417)
+++ mgmt/trunk/mint/python/mint/__init__.py 2008-09-05 15:44:05 UTC (rev 2418)
@@ -150,14 +150,14 @@
self.mchan = None
def getObject(self, cls, id):
- id = id.second # XXX new id hack
+ compositeId = "%s:%s" % (id.first, id.second)
try:
- obj = self.objectsById[id]
+ obj = self.objectsById[compositeId]
except KeyError:
try:
- obj = cls.selectBy(idOriginal=id, managedBroker=self.id)[0]
- self.objectsById[id] = obj
+ obj = cls.selectBy(idSourceScope=id.first, idSourceObject=id.second, managedBroker=self.id)[0]
+ self.objectsById[compositeId] = obj
except IndexError:
raise ObjectNotFound()
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-09-05 15:00:30 UTC (rev 2417)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-09-05 15:44:05 UTC (rev 2418)
@@ -91,20 +91,16 @@
for elem in elements:
elemName = self.renameReservedWord(elem["@name"])
if (elem["@type"] == "objId"):
- if (elemName.endswith("Ref")):
- reference = elem["@references"]
- # handle cases where the referenced class is in a different namespace (ie, contains a ".")
- namespaceIndex = reference.find(".")
- if (namespaceIndex > 0):
- reference = reference[namespaceIndex + 1:]
- reference = self.style.dbTableToPythonClass(reference)
- reference = self.renameReservedWord(reference)
- attrib = reference[0].lower() + reference[1:]
- self.generateForeignKeyAttrib(attrib, reference)
- self.generateMultipleJoin(reference, self.currentClass)
- else:
- # if reference doesn't have a "Ref" prefix, handle as a large uint
- self.generateAttrib(self.attrNameFromDbColumn(elemName), self.dataTypesMap["uint64"])
+ reference = elem["@references"]
+ # handle cases where the referenced class is in a different namespace (ie, contains a ".")
+ namespaceIndex = reference.find(".")
+ if (namespaceIndex > 0):
+ reference = reference[namespaceIndex + 1:]
+ reference = self.style.dbTableToPythonClass(reference)
+ reference = self.renameReservedWord(reference)
+ attrib = reference[0].lower() + reference[1:]
+ self.generateForeignKeyAttrib(attrib, reference)
+ self.generateMultipleJoin(reference, self.currentClass)
elif (elem["@type"].startswith("hilo")):
self.generateHiLoAttrib(self.attrNameFromDbColumn(elemName), self.dataTypesMap[elem["@type"]])
elif (elem["@type"].startswith("mma")):
@@ -131,12 +127,13 @@
self.currentClass = pythonName
self.pythonOutput += "\nclass %s(SQLObject):\n" % (pythonName)
self.generateLazyUpdate()
- self.generateAttrib("idOriginal", "BigIntCol")
self.generateTimestampAttrib("rec")
if (stats):
self.generateForeignKeyAttrib(colPythonName[0].lower() + colPythonName[1:], keyPythonName)
self.generateMultipleJoin(origPythonName, pythonName, "stats")
else:
+ self.generateAttrib("idSourceScope", "BigIntCol")
+ self.generateAttrib("idSourceObject", "BigIntCol")
self.generateTimestampAttrib("creation")
self.generateTimestampAttrib("deletion")
self.generateAttrib("managedBroker", "StringCol", "length=1000")
Modified: mgmt/trunk/mint/python/mint/update.py
===================================================================
--- mgmt/trunk/mint/python/mint/update.py 2008-09-05 15:00:30 UTC (rev 2417)
+++ mgmt/trunk/mint/python/mint/update.py 2008-09-05 15:44:05 UTC (rev 2418)
@@ -68,9 +68,10 @@
def processAttributes(conn, attrs, cls):
if "id" in attrs:
- # XXX new id hack
- idorig = attrs.pop("id").second
- attrs["idOriginal"] = idorig
+ id = attrs.pop("id")
+ if (not cls.__name__.endswith("Stats")):
+ attrs["idSourceScope"] = id.first
+ attrs["idSourceObject"] = id.second
if "connectionRef" in attrs:
attrs["clientConnectionRef"] = attrs.pop("connectionRef")
@@ -153,7 +154,6 @@
attrs = dict(self.props)
id = attrs["id"]
-
processAttributes(self.conn, attrs, cls)
# XXX move these down to the try/except
17 years, 7 months
rhmessaging commits: r2417 - in store/branches/java/broker-queue-refactor/java/bdbstore/src: test/java/org/apache/qpid/server/store/berkeleydb and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2008-09-05 11:00:30 -0400 (Fri, 05 Sep 2008)
New Revision: 2417
Modified:
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java
Log:
RHM-6 : Ensure that upgrading an already upgraded store correctly fails.
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2008-09-05 14:03:23 UTC (rev 2416)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2008-09-05 15:00:30 UTC (rev 2417)
@@ -256,6 +256,7 @@
{
if (_version != 1)
{
+ closeEnvironment();
throw new DatabaseException("Error: Attempting to start BDBStore version " + _version
+ " with a version 1 store. Please Upgrade");
}
@@ -270,7 +271,9 @@
if (version != _version)
{
- throw new DatabaseException("Error: Attempting to start BDBStore version " + _version + " with a version " + version + " store. Please Upgrade");
+ closeEnvironment();
+ throw new DatabaseException("Error: Unable to load BDBStore as version " + _version
+ + ". Store on disk contains version " + version + " data.");
}
}
}
@@ -337,6 +340,11 @@
*/
public void close() throws Exception
{
+ if (_state != State.STARTED)
+ {
+ return;
+ }
+
_state = State.CLOSING;
_commitThread.close();
@@ -378,6 +386,13 @@
_deliveryDb.close();
}
+ closeEnvironment();
+
+ _state = State.CLOSED;
+ }
+
+ private void closeEnvironment() throws DatabaseException
+ {
if (_environment != null)
{
// Clean the log before closing. This makes sure it doesn't contain
@@ -386,8 +401,6 @@
_environment.cleanLog();
_environment.close();
}
-
- _state = State.CLOSED;
}
/**
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java 2008-09-05 14:03:23 UTC (rev 2416)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java 2008-09-05 15:00:30 UTC (rev 2417)
@@ -108,7 +108,7 @@
catch (Exception e)
{
assertTrue("Incorrect Exception Thrown:" + e.getMessage(),
- e.getMessage().contains("Attempting to start BDBStore version 1 with a version 2 store"));
+ e.getMessage().contains("Unable to load BDBStore as version 1. Store on disk contains version 2 data"));
}
}
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java 2008-09-05 14:03:23 UTC (rev 2416)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/tools/java/org/apache/qpid/server/store/berkeleydb/BDBStoreUpgrade.java 2008-09-05 15:00:30 UTC (rev 2417)
@@ -131,25 +131,35 @@
_newMessageStore = new BDBMessageStore();
_newMessageStore.configure(_newVirtualHost, toDir);
- //Load the old MessageStore
- switch (version)
+ AMQException openException=null;
+ try{
+ //Load the old MessageStore
+ switch (version)
+ {
+ default:
+ case 1:
+ _oldMessageStore = new BDBMessageStore(1);
+ _oldMessageStore.configure(_oldVirtualHost, fromDir);
+ upgradeFromVersion_1();
+ break;
+ }
+ }
+ catch(AMQException amq)
{
- default:
- case 1:
- _oldMessageStore = new BDBMessageStore(1);
- _oldMessageStore.configure(_oldVirtualHost, fromDir);
- upgradeFromVersion_1();
- break;
+
}
+ finally
+ {
+ _newVirtualHost.close();
+ _oldVirtualHost.close();
- _oldMessageStore.close();
- _newMessageStore.close();
+ _newMessageStore.close();
+ _oldMessageStore.close();
- _newVirtualHost.close();
- _oldVirtualHost.close();
- //Shutdown the AR that the Vhosts will have created.
- ApplicationRegistry.remove(1);
+ //Shutdown the AR that the Vhosts will have created.
+ ApplicationRegistry.remove(1);
+ }
}
private void upgradeFromVersion_1() throws AMQException, DatabaseException
17 years, 7 months
rhmessaging commits: r2416 - in store/branches/java/broker-queue-refactor/java/bdbstore/src: test/java/org/apache/qpid/server/store/berkeleydb and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2008-09-05 10:03:23 -0400 (Fri, 05 Sep 2008)
New Revision: 2416
Modified:
store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
Log:
RHM-6 : Version all the tables and ensure that the upgrade script cannont be run on an upgraded store. Includes Unit test
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2008-09-04 16:32:40 UTC (rev 2415)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2008-09-05 14:03:23 UTC (rev 2416)
@@ -80,12 +80,11 @@
private static final int DATABASE_FORMAT_VERSION = 2;
private static final String DATABASE_FORMAT_VERSION_PROPERTY = "version";
-
public static final String ENVIRONMENT_PATH_PROPERTY = "environment-path";
private Environment _environment;
- private static final String MESSAGEMETADATADB_NAME = "messageMetaDataDb";
+ private String MESSAGEMETADATADB_NAME = "messageMetaDataDb";
/**
* Maps from messageId to an AMQMessage (note we don't use serialisation but this is what it roughly corresponds
@@ -93,30 +92,24 @@
*/
private Database _messageMetaDataDb;
- private static final String MESSAGECONTENTDB_NAME = "messageContentDb";
+ private String MESSAGECONTENTDB_NAME = "messageContentDb";
private Database _messageContentDb;
- private static final String QUEUEDB_NAME = "queueDb";
+ private String QUEUEDB_NAME = "queueDb";
- private static final String NEW_QUEUE_DB_NAME = "QUEUE";
-
/** Maps from name (which uniquely identifies a queue) to an AMQQueue */
private Database _queueDb;
- private static final String DELIVERYDB_NAME = "deliveryDb";
+ private String DELIVERYDB_NAME = "deliveryDb";
- private static final String QUEUE_ENTRY_DB_NAME = "QUEUE_ENTRY";
-
/** Maps from a queue name to a message id. This is what stores the pending deliveries for a given queue */
private Database _deliveryDb;
- private static final String EXCHANGEDB_NAME = "exchangeDb";
+ private String EXCHANGEDB_NAME = "exchangeDb";
private Database _exchangeDb;
- private static final String NEW_EXCHANGE_DB_NAME = "EXCHANGE";
-
- private static final String QUEUEBINDINGSDB_NAME = "queueBindingsDb";
+ private String QUEUEBINDINGSDB_NAME = "queueBindingsDb";
private Database _queueBindingsDb;
private VirtualHost _virtualHost;
@@ -125,8 +118,6 @@
private final AtomicLong _queueId = new AtomicLong(1);
- private static final AMQShortString EMPTY_SHORT_STRING = new AMQShortString("");
-
private final CommitThread _commitThread = new CommitThread("Commit-Thread");
private Map<AMQShortString, Long> _queueNameToIdMap = new ConcurrentHashMap<AMQShortString, Long>();
@@ -162,6 +153,24 @@
_version = version;
}
+ private void setDatabaseNames(int version)
+ {
+ if (version > 1)
+ {
+ MESSAGEMETADATADB_NAME += "_v" + version;
+
+ MESSAGECONTENTDB_NAME += "_v" + version;
+
+ QUEUEDB_NAME += "_v" + version;
+
+ DELIVERYDB_NAME += "_v" + version;
+
+ EXCHANGEDB_NAME += "_v" + version;
+
+ QUEUEBINDINGSDB_NAME += "_v" + version;
+ }
+ }
+
/**
* Called after instantiation in order to configure the message store. A particular implementation can define
* whatever parameters it wants.
@@ -176,6 +185,7 @@
*/
public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
{
+ boolean verifyVersion = false;
File environmentPath = new File(config.getString(base + "." + ENVIRONMENT_PATH_PROPERTY, "bdbEnv"));
if (!environmentPath.exists())
@@ -187,9 +197,8 @@
}
}
- _version = config.getInt(base + "." + DATABASE_FORMAT_VERSION_PROPERTY, 2);
+ _version = config.getInt(base + "." + DATABASE_FORMAT_VERSION_PROPERTY, DATABASE_FORMAT_VERSION);
-
configure(virtualHost, environmentPath);
}
@@ -204,6 +213,8 @@
_log.info("Configuring BDB message store");
+ setDatabaseNames(_version);
+
if (virtualHost != null)
{
setVirtualHost(virtualHost);
@@ -227,11 +238,43 @@
createEnvironment(storePath);
+ verifyVersionByTables();
+
openDatabases();
_commitThread.start();
}
+ private void verifyVersionByTables() throws DatabaseException
+ {
+ for (String s : _environment.getDatabaseNames())
+ {
+ int versionIndex = s.indexOf("_v");
+
+ // DB is v1 if _version is not v1 then error
+ if (versionIndex == -1)
+ {
+ if (_version != 1)
+ {
+ throw new DatabaseException("Error: Attempting to start BDBStore version " + _version
+ + " with a version 1 store. Please Upgrade");
+ }
+ else // DB is v1 and _version is v1
+ {
+ continue;
+ }
+ }
+ // Otherwise Check Versions
+
+ int version = Integer.parseInt(s.substring(versionIndex + 2));
+
+ if (version != _version)
+ {
+ throw new DatabaseException("Error: Attempting to start BDBStore version " + _version + " with a version " + version + " store. Please Upgrade");
+ }
+ }
+ }
+
protected void startStore() throws AMQException
{
stateTransition(State.CONFIGURED, State.STARTED);
Modified: store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
===================================================================
--- store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java 2008-09-04 16:32:40 UTC (rev 2415)
+++ store/branches/java/broker-queue-refactor/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java 2008-09-05 14:03:23 UTC (rev 2416)
@@ -52,10 +52,10 @@
private String _topic = "MyDurableSubscriptionTestTopic";
- String _fromDir = System.getProperty("QPID_WORK")+"/version1Store";
- String _toDir = System.getProperty("QPID_WORK")+"/version2Store";
+ String _fromDir = System.getProperty("QPID_WORK") + "/version1Store";
+ String _toDir = System.getProperty("QPID_WORK") + "/version2Store";
+ String _toDirTwice = System.getProperty("QPID_WORK") + "/version2StoreUpgradeTwice";
-
public void setUp() throws IOException
{
assertNotNull("QPID_WORK must be set", System.getProperty("QPID_WORK"));
@@ -65,8 +65,15 @@
if (directory.exists() && directory.isDirectory())
{
FileUtils.delete(directory, true);
- }
+ }
+ directory = new File(_toDirTwice);
+
+ if (directory.exists() && directory.isDirectory())
+ {
+ FileUtils.delete(directory, true);
+ }
+
directory = new File(_fromDir);
if (directory.exists() && directory.isDirectory())
@@ -74,9 +81,37 @@
FileUtils.delete(directory, true);
}
+
}
+ public void testMultipleUpgrades() throws Exception
+ {
+ String broker = "vm://:1";
+ startBroker(1, VERSION_1);
+
+ //Ensure msg were transitioned to new broker
+ sendAndCheckDurableSubscriber(broker, true, true, 5, null);
+
+ //Reset the Selector Pattern
+ new DurableSubscriber(broker, _topic, "odd=true").close();
+
+ stopBroker(1);
+
+ upgradeBroker();
+
+ try
+ {
+ new BDBStoreUpgrade(_toDir, _toDirTwice).upgradeFromVersion(1);
+ fail("Second Upgrade Succeeded");
+ }
+ catch (Exception e)
+ {
+ assertTrue("Incorrect Exception Thrown:" + e.getMessage(),
+ e.getMessage().contains("Attempting to start BDBStore version 1 with a version 2 store"));
+ }
+ }
+
public void testDurababilitySelectors() throws Exception
{
String broker = "vm://:1";
@@ -96,7 +131,7 @@
upgradeBroker();
broker = "vm://:2";
-
+
startBroker(2, VERSION_2);
//Ensure msg were transitioned to new broker
@@ -111,7 +146,7 @@
//Ensure that the selector was preseved on restart and caused all msgs to be removed.
sendAndCheckDurableSubscriber(broker, false, false, 0, null);
- stopBroker(2);
+ stopBroker(2);
}
public void testDurabability() throws Exception
17 years, 7 months