rhmessaging commits: r2122 - in mgmt/mint: sql and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-03 17:59:26 -0400 (Tue, 03 Jun 2008)
New Revision: 2122
Modified:
mgmt/mint/python/mint/schema.py
mgmt/mint/sql/schema.sql
Log:
bring detachedLifespan back to uint32
Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py 2008-06-03 21:51:09 UTC (rev 2121)
+++ mgmt/mint/python/mint/schema.py 2008-06-03 21:59:26 UTC (rev 2122)
@@ -513,7 +513,7 @@
name = StringCol(length=1000, default=None)
channelId = SmallIntCol(default=None)
clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
- detachedLifespan = BigIntCol(default=None)
+ detachedLifespan = IntCol(default=None)
classInfos = dict() # brokerId => classInfo
Modified: mgmt/mint/sql/schema.sql
===================================================================
--- mgmt/mint/sql/schema.sql 2008-06-03 21:51:09 UTC (rev 2121)
+++ mgmt/mint/sql/schema.sql 2008-06-03 21:59:26 UTC (rev 2122)
@@ -316,7 +316,7 @@
name VARCHAR(1000),
channel_id SMALLINT,
client_connection_id INT,
- detached_lifespan BIGINT
+ detached_lifespan INT
);
CREATE TABLE session_stats (
16 years, 6 months
rhmessaging commits: r2121 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-03 17:51:09 -0400 (Tue, 03 Jun 2008)
New Revision: 2121
Modified:
mgmt/mint/python/mint/__init__.py
Log:
upon Schema Mismatch error, reattempt without missing attribute -- supports multiple missing attributes now
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-03 20:29:57 UTC (rev 2120)
+++ mgmt/mint/python/mint/__init__.py 2008-06-03 21:51:09 UTC (rev 2121)
@@ -350,8 +350,8 @@
self.debug = debug
def log(self, message):
- #if (self.debug):
- print message
+ if (self.debug):
+ print message
def sanitizeDict(self, d):
if ("id" in d):
@@ -360,7 +360,7 @@
d["clientConnectionRef"] = d.pop("connectionRef")
#XXX FIX -- fix handling of field tables
if ("arguments" in d):
- print d.pop("arguments")
+ d.pop("arguments")
#XXX FIX -- fix handling of field tables
return d
@@ -430,8 +430,11 @@
if (not obj):
self.log("Couldn't find type %s id %s" % (objectName, d["idOriginal"]))
return
- obj.set(**d)
- obj.syncUpdate()
+
+ obj = self.updateObjWithDict(obj, d)
+ if (not obj):
+ return
+
except TypeError, detail:
self.log("TypeError: Schema mismatch: %s" % detail)
return
@@ -464,62 +467,34 @@
self.log("Couldn't find type %s id %s" % (objectName, d[self.convertIdKey("id")]))
print "lion", classInfo, list
return
-
+
origObjName = objectName[0].lower() + objectName[1:]
d[origObjName] = obj
objNameStats = eval("schema.%sStats" % (schema.schemaNameToClassMap[objectName].__name__))
objStats = objNameStats.__new__(objNameStats)
objStats.__init__()
-
+
if (not objStats):
self.log("Couldn't find type %s id %s" % (objNameStats, d[self.convertIdKey("id")]))
return
-
- objStats.set(**d)
- objStats.syncUpdate()
- except TypeError, detail:
- self.log("TypeError: Schema mismatch: %s" % detail)
- detailString = detail.__str__()
- errorString = "got an unexpected keyword argument "
- index = detailString.index(errorString)
- if (index >= 0):
- # argument in dict is not in schema, so remove it and re-attempt
- index += len(errorString)
- missingAttrib = detailString[index:]
- self.log("Reattempting without %s attribute" % missingAttrib)
- d.pop(missingAttrib)
- objStats.set(**d)
- objStats.syncUpdate()
- else:
+
+ objStats = self.updateObjWithDict(objStats, d)
+ if (not objStats):
return
- except KeyError, detail:
- self.log("KeyError: Schema mismatch: %s" % detail)
- return
- try:
d = dict()
+ d["statsPrev"] = obj.statsCurr
+ d["statsCurr"] = objStats
if (timestamps[2] != 0):
d["deletionTime"] = datetime.fromtimestamp(timestamps[2]/1000000000)
- d["statsPrev"] = obj.statsCurr
- d["statsCurr"] = objStats
- obj.set(**d)
- obj.syncUpdate()
+ obj = self.updateObjWithDict(obj, d)
+ if (not obj):
+ return
+
except TypeError, detail:
self.log("TypeError: Schema mismatch: %s" % detail)
- detailString = detail.__str__()
- errorString = "got an unexpected keyword argument "
- index = detailString.index(errorString)
- if (index >= 0):
- # argument in dict is not in schema, so remove it and re-attempt
- index += len(errorString)
- missingAttrib = detailString[index:]
- self.log("Reattempting without %s attribute" % missingAttrib)
- d.pop(missingAttrib)
- obj.set(**d)
- obj.syncUpdate()
- else:
- return
+ return
except KeyError, detail:
self.log("KeyError: Schema mismatch: %s" % detail)
return
@@ -527,6 +502,37 @@
self.log("END INST---------------------------------------------------\n")
return objStats
+ def updateObjWithDict(self, obj, d):
+ updateDone = False
+ reattemptCount = 0
+ while not updateDone:
+ try:
+ obj.set(**d)
+ obj.syncUpdate()
+ updateDone = True
+ if (reattemptCount > 0):
+ self.log("Reattempts successful")
+ except TypeError, detail:
+ self.log("TypeError: Schema mismatch: %s" % detail)
+ detailString = detail.__str__()
+ errorString = "got an unexpected keyword argument "
+ index = detailString.index(errorString)
+ if (index >= 0):
+ # argument in dict is not in schema, so remove it and re-attempt
+ index += len(errorString)
+ missingAttrib = detailString[index:]
+ self.log("Reattempting without %s attribute" % missingAttrib)
+ d.pop(missingAttrib)
+ reattemptCount += 1
+ else:
+ # can't recover
+ self.log("Non-recoverable schema mismatch, information lost")
+ return None
+ except KeyError, detail:
+ self.log("KeyError: Schema mismatch: %s" % detail)
+ return None
+ return obj
+
def methodCallback(self, brokerId, methodId, errorNo, errorText, args):
self.log("\nMETHOD---------------------------------------------------")
self.log("MethodId=%d" % (methodId))
16 years, 6 months
rhmessaging commits: r2120 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-03 16:29:57 -0400 (Tue, 03 Jun 2008)
New Revision: 2120
Modified:
mgmt/mint/python/mint/__init__.py
Log:
upon Schema Mismatch error, reattempt without missing attribute
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-03 17:22:06 UTC (rev 2119)
+++ mgmt/mint/python/mint/__init__.py 2008-06-03 20:29:57 UTC (rev 2120)
@@ -350,8 +350,8 @@
self.debug = debug
def log(self, message):
- if (self.debug):
- print message
+ #if (self.debug):
+ print message
def sanitizeDict(self, d):
if ("id" in d):
@@ -360,7 +360,7 @@
d["clientConnectionRef"] = d.pop("connectionRef")
#XXX FIX -- fix handling of field tables
if ("arguments" in d):
- d.pop("arguments")
+ print d.pop("arguments")
#XXX FIX -- fix handling of field tables
return d
@@ -477,7 +477,26 @@
objStats.set(**d)
objStats.syncUpdate()
+ except TypeError, detail:
+ self.log("TypeError: Schema mismatch: %s" % detail)
+ detailString = detail.__str__()
+ errorString = "got an unexpected keyword argument "
+ index = detailString.index(errorString)
+ if (index >= 0):
+ # argument in dict is not in schema, so remove it and re-attempt
+ index += len(errorString)
+ missingAttrib = detailString[index:]
+ self.log("Reattempting without %s attribute" % missingAttrib)
+ d.pop(missingAttrib)
+ objStats.set(**d)
+ objStats.syncUpdate()
+ else:
+ return
+ except KeyError, detail:
+ self.log("KeyError: Schema mismatch: %s" % detail)
+ return
+ try:
d = dict()
if (timestamps[2] != 0):
d["deletionTime"] = datetime.fromtimestamp(timestamps[2]/1000000000)
@@ -488,7 +507,19 @@
obj.syncUpdate()
except TypeError, detail:
self.log("TypeError: Schema mismatch: %s" % detail)
- return
+ detailString = detail.__str__()
+ errorString = "got an unexpected keyword argument "
+ index = detailString.index(errorString)
+ if (index >= 0):
+ # argument in dict is not in schema, so remove it and re-attempt
+ index += len(errorString)
+ missingAttrib = detailString[index:]
+ self.log("Reattempting without %s attribute" % missingAttrib)
+ d.pop(missingAttrib)
+ obj.set(**d)
+ obj.syncUpdate()
+ else:
+ return
except KeyError, detail:
self.log("KeyError: Schema mismatch: %s" % detail)
return
16 years, 6 months
rhmessaging commits: r2119 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-03 13:22:06 -0400 (Tue, 03 Jun 2008)
New Revision: 2119
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/parameters.py
mgmt/cumin/python/cumin/test.py
Log:
Change uses of Connection to ClientConnection
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-06-03 17:10:12 UTC (rev 2118)
+++ mgmt/cumin/python/cumin/model.py 2008-06-03 17:22:06 UTC (rev 2119)
@@ -817,7 +817,8 @@
class CuminConnection(RemoteClass):
def __init__(self, model):
- super(CuminConnection, self).__init__(model, "clientConnection", ClientConnection,
+ super(CuminConnection, self).__init__(model, "connection",
+ ClientConnection,
ClientConnectionStats)
prop = CuminProperty(self, "address")
Modified: mgmt/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/cumin/python/cumin/parameters.py 2008-06-03 17:10:12 UTC (rev 2118)
+++ mgmt/cumin/python/cumin/parameters.py 2008-06-03 17:22:06 UTC (rev 2119)
@@ -46,7 +46,7 @@
class ConnectionParameter(Parameter):
def do_unmarshal(self, string):
- return Connection.get(int(string))
+ return ClientConnection.get(int(string))
def do_marshal(self, conn):
return str(conn.id)
Modified: mgmt/cumin/python/cumin/test.py
===================================================================
--- mgmt/cumin/python/cumin/test.py 2008-06-03 17:10:12 UTC (rev 2118)
+++ mgmt/cumin/python/cumin/test.py 2008-06-03 17:22:06 UTC (rev 2119)
@@ -392,10 +392,10 @@
str(self.env.broker_conn.port)
try:
- self.env.conn = Connection.selectBy \
+ self.env.conn = ClientConnection.selectBy \
(vhost=vhost, address=address)[0]
except IndexError:
- raise Exception("Connection not found")
+ raise Exception("ClientConnection not found")
self.run_children(session)
16 years, 6 months
rhmessaging commits: r2118 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-03 13:10:12 -0400 (Tue, 03 Jun 2008)
New Revision: 2118
Modified:
mgmt/cumin/python/cumin/client.strings
Log:
Correct table names
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2008-06-03 15:38:55 UTC (rev 2117)
+++ mgmt/cumin/python/cumin/client.strings 2008-06-03 17:10:12 UTC (rev 2118)
@@ -15,17 +15,17 @@
/ (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 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
+from client_connection as l
+left outer join client_connection_stats as c on c.id = l.stats_curr_id
+left outer join client_connection_stats as p on p.id = l.stats_prev_id
{sql_where}
{sql_orderby}
{sql_limit}
[ConnectionSet.count_sql]
select count(*)
-from connection as l
-left outer join connection_stats as c on c.id = l.stats_curr_id
+from client_connection as l
+left outer join client_connection_stats as c on c.id = l.stats_curr_id
{sql_where}
[ConnectionSet.html]
16 years, 6 months
rhmessaging commits: r2117 - in mgmt: mint/python/mint and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-06-03 11:38:55 -0400 (Tue, 03 Jun 2008)
New Revision: 2117
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/model.py
mgmt/mint/python/mint/__init__.py
mgmt/mint/python/mint/schema.py
mgmt/mint/python/mint/schemaparser.py
mgmt/mint/sql/schema.sql
Log:
rename Connection to ClientConnection to avoid name conflicts
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-06-03 15:10:09 UTC (rev 2116)
+++ mgmt/cumin/python/cumin/client.py 2008-06-03 15:38:55 UTC (rev 2117)
@@ -50,7 +50,7 @@
return self.unit.get(session) == "b" and "Bytes" or "Frames"
def render_title(self, session, vhost):
- return "Connections %s" % fmt_count(vhost.connections.count())
+ return "Connections %s" % fmt_count(vhost.clientConnections.count())
def render_sql_where(self, session, vhost):
elems = list()
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-06-03 15:10:09 UTC (rev 2116)
+++ mgmt/cumin/python/cumin/model.py 2008-06-03 15:38:55 UTC (rev 2117)
@@ -817,8 +817,8 @@
class CuminConnection(RemoteClass):
def __init__(self, model):
- super(CuminConnection, self).__init__(model, "connection", Connection,
- ConnectionStats)
+ super(CuminConnection, self).__init__(model, "clientConnection", ClientConnection,
+ ClientConnectionStats)
prop = CuminProperty(self, "address")
prop.title = "Address"
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-03 15:10:09 UTC (rev 2116)
+++ mgmt/mint/python/mint/__init__.py 2008-06-03 15:38:55 UTC (rev 2117)
@@ -356,6 +356,8 @@
def sanitizeDict(self, d):
if ("id" in d):
d[self.convertIdKey("id")] = d.pop("id")
+ if ("connectionRef" in d):
+ d["clientConnectionRef"] = d.pop("connectionRef")
#XXX FIX -- fix handling of field tables
if ("arguments" in d):
d.pop("arguments")
@@ -377,21 +379,30 @@
keys.append(key)
return keys
+ def fixClassInfo(self, classInfo):
+ objectName = self.initialCapital(classInfo[1])
+ if (objectName == "Connection"):
+ objectName = "ClientConnection"
+ return objectName
+
+ def initialCapital(self, string):
+ return string[0].upper() + string[1:]
+
def setCloseListener(self, connCloseListener):
self.connCloseListener = connCloseListener
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].capitalize())
+ objectName = self.fixClassInfo(classInfo)
+ self.log("BrokerId=%s , objectName=%s" % (brokerId, objectName))
+ cls = schema.schemaNameToClassMap.get(objectName)
if cls:
cls.classInfos[brokerId] = classInfo
self.log("\nEND SCHEMA---------------------------------------------------")
-
def configCallback(self, brokerId, classInfo, list, timestamps):
self.log("\nCONFIG---------------------------------------------------")
- objectName = classInfo[1].capitalize()
+ objectName = self.fixClassInfo(classInfo)
brokerUUID = classInfo[2]
self.log(objectName)
d = self.sanitizeDict(dict(list))
@@ -409,13 +420,12 @@
try:
for parentKey in self.findParentKeys(d):
convertedKey = self.convertRefKey(parentKey)
- cls = schema.schemaNameToClassMap.get(convertedKey.capitalize())
- if (convertedKey == "connection"):
- convertedKey = "clientConnection"
+ cls = schema.schemaNameToClassMap.get(self.initialCapital(convertedKey))
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"]))
@@ -434,7 +444,7 @@
def instCallback(self, brokerId, classInfo, list, timestamps):
self.log("\nINST---------------------------------------------------")
- objectName = classInfo[1].capitalize()
+ objectName = self.fixClassInfo(classInfo)
brokerUUID = classInfo[2]
self.log(objectName)
d = self.sanitizeDict(dict(list))
@@ -455,9 +465,7 @@
print "lion", classInfo, list
return
- origObjName = classInfo[1]
- if (origObjName == "connection"):
- origObjName = "clientConnection"
+ origObjName = objectName[0].lower() + objectName[1:]
d[origObjName] = obj
objNameStats = eval("schema.%sStats" % (schema.schemaNameToClassMap[objectName].__name__))
objStats = objNameStats.__new__(objNameStats)
Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py 2008-06-03 15:10:09 UTC (rev 2116)
+++ mgmt/mint/python/mint/schema.py 2008-06-03 15:38:55 UTC (rev 2117)
@@ -224,6 +224,7 @@
msgPersistEnqueues = BigIntCol(default=None)
msgPersistDequeues = BigIntCol(default=None)
msgDepth = IntCol(default=None)
+ byteDepth = IntCol(default=None)
byteTotalEnqueues = BigIntCol(default=None)
byteTotalDequeues = BigIntCol(default=None)
byteTxnEnqueues = BigIntCol(default=None)
@@ -344,7 +345,7 @@
Binding.sqlmeta.addJoin(SQLMultipleJoin('BindingStats', joinMethodName='stats'))
-class Connection(SQLObject):
+class ClientConnection(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -353,8 +354,8 @@
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- statsCurr = ForeignKey('ConnectionStats', cascade='null', default=None)
- statsPrev = ForeignKey('ConnectionStats', cascade='null', default=None)
+ statsCurr = ForeignKey('ClientConnectionStats', cascade='null', default=None)
+ statsPrev = ForeignKey('ClientConnectionStats', cascade='null', default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
address = StringCol(length=1000, default=None)
incoming = BoolCol(default=None)
@@ -368,16 +369,16 @@
conn.callMethod(self.idOriginal, classInfo, "close",
callback, args=actualArgs)
-Vhost.sqlmeta.addJoin(SQLMultipleJoin('Connection', joinMethodName='connections'))
+Vhost.sqlmeta.addJoin(SQLMultipleJoin('ClientConnection', joinMethodName='clientConnections'))
-class ConnectionStats(SQLObject):
+class ClientConnectionStats(SQLObject):
class sqlmeta:
lazyUpdate = True
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
- clientConnection = ForeignKey('Connection', cascade='null', default=None)
+ clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
closing = BoolCol(default=None)
authIdentity = StringCol(length=1000, default=None)
framesFromClient = BigIntCol(default=None)
@@ -387,7 +388,7 @@
classInfos = dict() # brokerId => classInfo
-Connection.sqlmeta.addJoin(SQLMultipleJoin('ConnectionStats', joinMethodName='stats'))
+ClientConnection.sqlmeta.addJoin(SQLMultipleJoin('ClientConnectionStats', joinMethodName='stats'))
class Link(SQLObject):
@@ -511,8 +512,8 @@
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
channelId = SmallIntCol(default=None)
- clientConnection = ForeignKey('Connection', cascade='null', default=None)
- detachedLifespan = IntCol(default=None)
+ clientConnection = ForeignKey('ClientConnection', cascade='null', default=None)
+ detachedLifespan = BigIntCol(default=None)
classInfos = dict() # brokerId => classInfo
@@ -546,7 +547,7 @@
Vhost.sqlmeta.addJoin(SQLMultipleJoin('Session', joinMethodName='sessions'))
-Connection.sqlmeta.addJoin(SQLMultipleJoin('Session', joinMethodName='sessions'))
+ClientConnection.sqlmeta.addJoin(SQLMultipleJoin('Session', joinMethodName='sessions'))
class SessionStats(SQLObject):
@@ -581,8 +582,8 @@
schemaNameToClassMap['Exchange'] = Exchange
classToSchemaNameMap['Binding'] = 'Binding'
schemaNameToClassMap['Binding'] = Binding
-classToSchemaNameMap['Connection'] = 'Connection'
-schemaNameToClassMap['Connection'] = Connection
+classToSchemaNameMap['ClientConnection'] = 'ClientConnection'
+schemaNameToClassMap['ClientConnection'] = ClientConnection
classToSchemaNameMap['Link'] = 'Link'
schemaNameToClassMap['Link'] = Link
classToSchemaNameMap['Bridge'] = 'Bridge'
Modified: mgmt/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/mint/python/mint/schemaparser.py 2008-06-03 15:10:09 UTC (rev 2116)
+++ mgmt/mint/python/mint/schemaparser.py 2008-06-03 15:38:55 UTC (rev 2117)
@@ -65,7 +65,7 @@
def generateMultipleJoin(self, tableFrom, tableTo, attrib=""):
if (attrib == ""):
- attrib = tableTo.lower() + "s"
+ attrib = tableTo[0].lower() + tableTo[1:] + "s"
self.additionalPythonOutput += "\n%s.sqlmeta.addJoin(SQLMultipleJoin('%s', joinMethodName='%s'))\n" % (tableFrom, tableTo, attrib)
def generateLazyUpdate(self, lazyUpdate=True):
@@ -80,6 +80,8 @@
if (elem["@type"] == "objId"):
if (elem["@name"].endswith("Ref")):
reference = self.style.dbTableToPythonClass(elem["@references"])
+ if (reference == "Connection"):
+ reference = "ClientConnection"
attrib = reference[0].lower() + reference[1:]
self.generateForeignKeyAttrib(attrib, reference)
self.generateMultipleJoin(reference, self.currentClass)
@@ -102,6 +104,8 @@
self.pythonOutput += " classInfos = dict() # brokerId => classInfo\n"
def startClass(self, schemaName, stats=False):
+ if (schemaName == "Connection"):
+ schemaName = "ClientConnection"
if (stats):
origPythonName = self.style.dbTableToPythonClass(schemaName)
pythonName = self.style.dbTableToPythonClass(schemaName + "_stats")
Modified: mgmt/mint/sql/schema.sql
===================================================================
--- mgmt/mint/sql/schema.sql 2008-06-03 15:10:09 UTC (rev 2116)
+++ mgmt/mint/sql/schema.sql 2008-06-03 15:38:55 UTC (rev 2117)
@@ -154,7 +154,7 @@
broker_id INT
);
-CREATE TABLE connection (
+CREATE TABLE client_connection (
id SERIAL PRIMARY KEY,
id_original BIGINT,
rec_time TIMESTAMP,
@@ -168,7 +168,7 @@
incoming BOOL
);
-CREATE TABLE connection_stats (
+CREATE TABLE client_connection_stats (
id SERIAL PRIMARY KEY,
id_original BIGINT,
rec_time TIMESTAMP,
@@ -269,6 +269,7 @@
msg_persist_enqueues BIGINT,
msg_persist_dequeues BIGINT,
msg_depth INT,
+ byte_depth INT,
byte_total_enqueues BIGINT,
byte_total_dequeues BIGINT,
byte_txn_enqueues BIGINT,
@@ -315,7 +316,7 @@
name VARCHAR(1000),
channel_id SMALLINT,
client_connection_id INT,
- detached_lifespan INT
+ detached_lifespan BIGINT
);
CREATE TABLE session_stats (
@@ -416,13 +417,13 @@
ALTER TABLE broker_stats ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id) REFERENCES broker (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_connection ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id) REFERENCES client_connection_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_connection ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id) REFERENCES client_connection_stats (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_connection ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES vhost (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 client_connection_stats ADD CONSTRAINT client_connection_id_exists FOREIGN KEY (client_connection_id) REFERENCES client_connection (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;
@@ -454,7 +455,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_connection_id_exists FOREIGN KEY (client_connection_id) REFERENCES connection (id) ON DELETE SET NULL;
+ALTER TABLE session ADD CONSTRAINT client_connection_id_exists FOREIGN KEY (client_connection_id) REFERENCES client_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;
16 years, 6 months
rhmessaging commits: r2116 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-03 11:10:09 -0400 (Tue, 03 Jun 2008)
New Revision: 2116
Modified:
mgmt/cumin/python/cumin/__init__.py
Log:
Also set last challenge time for first time authorizations
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2008-06-03 14:29:51 UTC (rev 2115)
+++ mgmt/cumin/python/cumin/__init__.py 2008-06-03 15:10:09 UTC (rev 2116)
@@ -127,6 +127,10 @@
if lout is None or lout < lch:
return True
+ else:
+ user.lastChallenged = datetime.now()
+ user.syncUpdate()
+ return True
user.lastChallenged = datetime.now()
user.syncUpdate()
16 years, 6 months
rhmessaging commits: r2115 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-03 10:29:51 -0400 (Tue, 03 Jun 2008)
New Revision: 2115
Modified:
mgmt/cumin/python/cumin/widgets.py
Log:
Handle null rec time
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-06-03 14:23:12 UTC (rev 2114)
+++ mgmt/cumin/python/cumin/widgets.py 2008-06-03 14:29:51 UTC (rev 2115)
@@ -417,8 +417,9 @@
def render_content(self, session, data):
key = self.get_column_key(session)
+ value = data["rec_time"]
- if data["rec_time"] > self.__ago.get(session):
+ if value and value > self.__ago.get(session):
html = self.render_value(session, data[key])
else:
html = fmt_none_brief()
16 years, 6 months
rhmessaging commits: r2114 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-03 10:23:12 -0400 (Tue, 03 Jun 2008)
New Revision: 2114
Modified:
mgmt/cumin/python/cumin/widgets.py
Log:
Don't filter out objects without stats
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-06-03 02:10:01 UTC (rev 2113)
+++ mgmt/cumin/python/cumin/widgets.py 2008-06-03 14:23:12 UTC (rev 2114)
@@ -370,10 +370,12 @@
phase = self.get(session)
if phase == "a":
- sql = "c.rec_time > now() - interval '10 minutes'"
+ sql = "c.rec_time is null or " + \
+ "c.rec_time > now() - interval '10 minutes'"
elif phase == "i":
- sql = "(c.rec_time <= now() - interval '10 minutes'" + \
- " and deletion_time is null)"
+ sql = "c.rec_time is null or " + \
+ "((c.rec_time <= now() - interval '10 minutes'" + \
+ " and deletion_time is null))"
else:
sql = "deletion_time is not null"
16 years, 6 months
rhmessaging commits: r2113 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-06-02 22:10:01 -0400 (Mon, 02 Jun 2008)
New Revision: 2113
Modified:
mgmt/mint/python/mint/__init__.py
Log:
For bz449706 - Serialize access to the original id dict
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2008-06-03 01:07:24 UTC (rev 2112)
+++ mgmt/mint/python/mint/__init__.py 2008-06-03 02:10:01 UTC (rev 2113)
@@ -121,12 +121,24 @@
class OriginalIdDict:
def __init__(self):
self.idMap = dict()
+ self.lock = Lock()
def set(self, idOriginal, obj):
self.idMap[idOriginal] = obj
-
+
def getByOriginalId(self, objType, idOriginal, managedBroker, create=False, args={}):
obj = None
+
+ self.lock.acquire()
+ try:
+ obj = self.doGetByOriginalId(objType, idOriginal, managedBroker, create, args)
+ finally:
+ self.lock.release()
+
+ return obj
+
+ def doGetByOriginalId(self, objType, idOriginal, managedBroker, create=False, args={}):
+ obj = None
key = (managedBroker, idOriginal)
if (key in self.idMap):
#print "\n\n=============== %s %d found\n\n" % (objType.__name__, idOriginal)
16 years, 6 months