Author: nunofsantos
Date: 2007-11-27 14:33:11 -0500 (Tue, 27 Nov 2007)
New Revision: 1373
Modified:
mgmt/mint/python/mint/schema.py
mgmt/mint/python/mint/schema.sql
Log:
add stats attrib, rename existing stats attrib to statsCurr
Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py 2007-11-27 19:32:35 UTC (rev 1372)
+++ mgmt/mint/python/mint/schema.py 2007-11-27 19:33:11 UTC (rev 1373)
@@ -7,7 +7,7 @@
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('SystemStats', cascade='null', default=None)
+ statsCurr = ForeignKey('SystemStats', cascade='null', default=None)
statsPrev = ForeignKey('SystemStats', cascade='null', default=None)
sysId = StringCol(length=1000, default=None)
@@ -16,13 +16,16 @@
recTime = TimestampCol(default=None)
system = ForeignKey('System', cascade='null', default=None)
+System.sqlmeta.addJoin(MultipleJoin('SystemStats',
joinMethodName='stats'))
+
+
class Broker(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('BrokerStats', cascade='null', default=None)
+ statsCurr = ForeignKey('BrokerStats', cascade='null', default=None)
statsPrev = ForeignKey('BrokerStats', cascade='null', default=None)
system = ForeignKey('System', cascade='null', default=None)
port = SmallIntCol(default=None)
@@ -74,13 +77,16 @@
recTime = TimestampCol(default=None)
broker = ForeignKey('Broker', cascade='null', default=None)
+Broker.sqlmeta.addJoin(MultipleJoin('BrokerStats',
joinMethodName='stats'))
+
+
class Vhost(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('VhostStats', cascade='null', default=None)
+ statsCurr = ForeignKey('VhostStats', cascade='null', default=None)
statsPrev = ForeignKey('VhostStats', cascade='null', default=None)
broker = ForeignKey('Broker', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -93,13 +99,16 @@
recTime = TimestampCol(default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
+Vhost.sqlmeta.addJoin(MultipleJoin('VhostStats',
joinMethodName='stats'))
+
+
class Queue(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('QueueStats', cascade='null', default=None)
+ statsCurr = ForeignKey('QueueStats', cascade='null', default=None)
statsPrev = ForeignKey('QueueStats', cascade='null', default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -198,13 +207,16 @@
unackedMessagesLow = IntCol(default=None)
unackedMessagesHigh = IntCol(default=None)
+Queue.sqlmeta.addJoin(MultipleJoin('QueueStats',
joinMethodName='stats'))
+
+
class Exchange(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('ExchangeStats', cascade='null', default=None)
+ statsCurr = ForeignKey('ExchangeStats', cascade='null', default=None)
statsPrev = ForeignKey('ExchangeStats', cascade='null', default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -230,13 +242,16 @@
byteDrops = BigIntCol(default=None)
byteRoutes = BigIntCol(default=None)
+Exchange.sqlmeta.addJoin(MultipleJoin('ExchangeStats',
joinMethodName='stats'))
+
+
class Binding(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('BindingStats', cascade='null', default=None)
+ statsCurr = ForeignKey('BindingStats', cascade='null', default=None)
statsPrev = ForeignKey('BindingStats', cascade='null', default=None)
queue = ForeignKey('Queue', cascade='null', default=None)
exchange = ForeignKey('Exchange', cascade='null', default=None)
@@ -253,13 +268,16 @@
binding = ForeignKey('Binding', cascade='null', default=None)
msgMatched = BigIntCol(default=None)
+Binding.sqlmeta.addJoin(MultipleJoin('BindingStats',
joinMethodName='stats'))
+
+
class Client(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('ClientStats', cascade='null', default=None)
+ statsCurr = ForeignKey('ClientStats', cascade='null', default=None)
statsPrev = ForeignKey('ClientStats', cascade='null', default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
ipAddr = IntCol(default=None)
@@ -290,13 +308,16 @@
bytesProduced = BigIntCol(default=None)
bytesConsumed = BigIntCol(default=None)
+Client.sqlmeta.addJoin(MultipleJoin('ClientStats',
joinMethodName='stats'))
+
+
class Session(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('SessionStats', cascade='null', default=None)
+ statsCurr = ForeignKey('SessionStats', cascade='null', default=None)
statsPrev = ForeignKey('SessionStats', cascade='null', default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -340,13 +361,16 @@
remainingLifespan = IntCol(default=None)
framesOutstanding = IntCol(default=None)
+Session.sqlmeta.addJoin(MultipleJoin('SessionStats',
joinMethodName='stats'))
+
+
class Destination(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('DestinationStats', cascade='null', default=None)
+ statsCurr = ForeignKey('DestinationStats', cascade='null',
default=None)
statsPrev = ForeignKey('DestinationStats', cascade='null',
default=None)
session = ForeignKey('Session', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -384,13 +408,16 @@
msgCredits = IntCol(default=None)
byteCredits = IntCol(default=None)
+Destination.sqlmeta.addJoin(MultipleJoin('DestinationStats',
joinMethodName='stats'))
+
+
class Producer(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('ProducerStats', cascade='null', default=None)
+ statsCurr = ForeignKey('ProducerStats', cascade='null', default=None)
statsPrev = ForeignKey('ProducerStats', cascade='null', default=None)
destination = ForeignKey('Destination', cascade='null', default=None)
exchange = ForeignKey('Exchange', cascade='null', default=None)
@@ -407,13 +434,16 @@
msgsProduced = BigIntCol(default=None)
bytesProduced = BigIntCol(default=None)
+Producer.sqlmeta.addJoin(MultipleJoin('ProducerStats',
joinMethodName='stats'))
+
+
class Consumer(SQLObject):
idOriginal = BigIntCol(default=None)
recTime = TimestampCol(default=None)
creationTime = TimestampCol(default=None)
deletionTime = TimestampCol(default=None)
managedBroker = StringCol(length=1000, default=None)
- stats = ForeignKey('ConsumerStats', cascade='null', default=None)
+ statsCurr = ForeignKey('ConsumerStats', cascade='null', default=None)
statsPrev = ForeignKey('ConsumerStats', cascade='null', default=None)
destination = ForeignKey('Destination', cascade='null', default=None)
queue = ForeignKey('Queue', cascade='null', default=None)
@@ -439,6 +469,9 @@
unackedMessagesLow = IntCol(default=None)
unackedMessagesHigh = IntCol(default=None)
+Consumer.sqlmeta.addJoin(MultipleJoin('ConsumerStats',
joinMethodName='stats'))
+
+
classToSchemaNameMap = dict()
schemaNameToClassMap = dict()
classToSchemaNameMap['System'] = 'system'
Modified: mgmt/mint/python/mint/schema.sql
===================================================================
--- mgmt/mint/python/mint/schema.sql 2007-11-27 19:32:35 UTC (rev 1372)
+++ mgmt/mint/python/mint/schema.sql 2007-11-27 19:33:11 UTC (rev 1373)
@@ -5,7 +5,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
queue_id INT,
exchange_id INT,
@@ -27,7 +27,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
system_id INT,
port SMALLINT,
@@ -58,7 +58,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
vhost_id INT,
ip_addr INT,
@@ -84,7 +84,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
destination_id INT,
queue_id INT
@@ -109,7 +109,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
session_id INT,
name VARCHAR(1000)
@@ -134,7 +134,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
vhost_id INT,
name VARCHAR(1000),
@@ -167,7 +167,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
destination_id INT,
exchange_id INT
@@ -189,7 +189,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
vhost_id INT,
name VARCHAR(1000),
@@ -280,7 +280,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
vhost_id INT,
name VARCHAR(1000),
@@ -305,7 +305,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
sys_id VARCHAR(1000)
);
@@ -324,7 +324,7 @@
creation_time TIMESTAMP,
deletion_time TIMESTAMP,
managed_broker VARCHAR(1000),
- stats_id INT,
+ stats_curr_id INT,
stats_prev_id INT,
broker_id INT,
name VARCHAR(1000)
@@ -337,7 +337,7 @@
vhost_id INT
);
-ALTER TABLE binding ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
binding_stats (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;
ALTER TABLE binding ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES binding_stats (id) ON DELETE SET NULL;
@@ -347,7 +347,7 @@
ALTER TABLE binding_stats ADD CONSTRAINT binding_id_exists FOREIGN KEY (binding_id)
REFERENCES binding (id) ON DELETE SET NULL;
-ALTER TABLE broker ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
broker_stats (id) ON DELETE SET NULL;
+ALTER TABLE broker ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES broker_stats (id) ON DELETE SET NULL;
ALTER TABLE broker ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES broker_stats (id) ON DELETE SET NULL;
@@ -355,7 +355,7 @@
ALTER TABLE broker_stats ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id)
REFERENCES broker (id) ON DELETE SET NULL;
-ALTER TABLE client ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
client_stats (id) ON DELETE SET NULL;
+ALTER TABLE client ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES client_stats (id) ON DELETE SET NULL;
ALTER TABLE client ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES client_stats (id) ON DELETE SET NULL;
@@ -363,7 +363,7 @@
ALTER TABLE client_stats ADD CONSTRAINT client_id_exists FOREIGN KEY (client_id)
REFERENCES client (id) ON DELETE SET NULL;
-ALTER TABLE consumer ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
consumer_stats (id) ON DELETE SET NULL;
+ALTER TABLE consumer ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES consumer_stats (id) ON DELETE SET NULL;
ALTER TABLE consumer ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES consumer_stats (id) ON DELETE SET NULL;
@@ -373,7 +373,7 @@
ALTER TABLE consumer_stats ADD CONSTRAINT consumer_id_exists FOREIGN KEY (consumer_id)
REFERENCES consumer (id) ON DELETE SET NULL;
-ALTER TABLE destination ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
destination_stats (id) ON DELETE SET NULL;
+ALTER TABLE destination ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES destination_stats (id) ON DELETE SET NULL;
ALTER TABLE destination ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES destination_stats (id) ON DELETE SET NULL;
@@ -381,7 +381,7 @@
ALTER TABLE destination_stats ADD CONSTRAINT destination_id_exists FOREIGN KEY
(destination_id) REFERENCES destination (id) ON DELETE SET NULL;
-ALTER TABLE exchange ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
exchange_stats (id) ON DELETE SET NULL;
+ALTER TABLE exchange ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES exchange_stats (id) ON DELETE SET NULL;
ALTER TABLE exchange ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES exchange_stats (id) ON DELETE SET NULL;
@@ -389,7 +389,7 @@
ALTER TABLE exchange_stats ADD CONSTRAINT exchange_id_exists FOREIGN KEY (exchange_id)
REFERENCES exchange (id) ON DELETE SET NULL;
-ALTER TABLE producer ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
producer_stats (id) ON DELETE SET NULL;
+ALTER TABLE producer ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES producer_stats (id) ON DELETE SET NULL;
ALTER TABLE producer ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES producer_stats (id) ON DELETE SET NULL;
@@ -399,7 +399,7 @@
ALTER TABLE producer_stats ADD CONSTRAINT producer_id_exists FOREIGN KEY (producer_id)
REFERENCES producer (id) ON DELETE SET NULL;
-ALTER TABLE queue ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
queue_stats (id) ON DELETE SET NULL;
+ALTER TABLE queue ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES queue_stats (id) ON DELETE SET NULL;
ALTER TABLE queue ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES queue_stats (id) ON DELETE SET NULL;
@@ -407,7 +407,7 @@
ALTER TABLE queue_stats ADD CONSTRAINT queue_id_exists FOREIGN KEY (queue_id) REFERENCES
queue (id) ON DELETE SET NULL;
-ALTER TABLE session ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
session_stats (id) ON DELETE SET NULL;
+ALTER TABLE session ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES session_stats (id) ON DELETE SET NULL;
ALTER TABLE session ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES session_stats (id) ON DELETE SET NULL;
@@ -417,13 +417,13 @@
ALTER TABLE session_stats ADD CONSTRAINT session_id_exists FOREIGN KEY (session_id)
REFERENCES session (id) ON DELETE SET NULL;
-ALTER TABLE system ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
system_stats (id) ON DELETE SET NULL;
+ALTER TABLE system ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES system_stats (id) ON DELETE SET NULL;
ALTER TABLE system ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES system_stats (id) ON DELETE SET NULL;
ALTER TABLE system_stats ADD CONSTRAINT system_id_exists FOREIGN KEY (system_id)
REFERENCES system (id) ON DELETE SET NULL;
-ALTER TABLE vhost ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
vhost_stats (id) ON DELETE SET NULL;
+ALTER TABLE vhost ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES vhost_stats (id) ON DELETE SET NULL;
ALTER TABLE vhost ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES vhost_stats (id) ON DELETE SET NULL;