Author: nunofsantos
Date: 2007-11-16 14:50:33 -0500 (Fri, 16 Nov 2007)
New Revision: 1325
Modified:
mgmt/mint/python/mint/schema.py
mgmt/mint/python/mint/schema.sql
Log:
new approach to code generation: generate Python from XML, and then use sqlobject-admin to
generate the corresponding SQL
Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py 2007-11-16 19:46:54 UTC (rev 1324)
+++ mgmt/mint/python/mint/schema.py 2007-11-16 19:50:33 UTC (rev 1325)
@@ -1,241 +1,366 @@
from sqlobject import *
+from datetime import datetime
+conn = connectionForURI("postgresql://localhost/")
+sqlhub.processConnection = conn
-class MintSystemStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
-class MintSystem(SQLObject):
- schemaId = 1
- schemaName = "system"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- _SO_class_Mint_system_stats = MintSystemStats
+class System(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('SystemStats', cascade='null', default=None)
+ sysId = StringCol(length=1000, default=None)
-class MintBrokerStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+class SystemStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ system = ForeignKey('System', cascade='null', default=None)
-class MintBroker(SQLObject):
- schemaId = 2
- schemaName = "broker"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- def joinCluster(self, model, callbackMethod, clusterName):
+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)
+ system = ForeignKey('System', cascade='null', default=None)
+ port = SmallIntCol(default=None)
+ workerThreads = SmallIntCol(default=None)
+ maxConns = SmallIntCol(default=None)
+ connBacklog = SmallIntCol(default=None)
+ stagingThreshold = IntCol(default=None)
+ storeLib = StringCol(length=1000, default=None)
+ asyncStore = BoolCol(default=None)
+ mgmtPubInterval = SmallIntCol(default=None)
+ initialDiskPageSize = IntCol(default=None)
+ initialPagesPerQueue = IntCol(default=None)
+ clusterName = StringCol(length=1000, default=None)
+ version = StringCol(length=1000, default=None)
+
+ def joinCluster(self, model, managedBrokerLabel, callbackMethod, clusterName):
actualArgs = dict()
actualArgs["clusterName"] = clusterName
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"joinCluster", args=actualArgs, packageName="qpid")
- def leaveCluster(self, model, callbackMethod):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "joinCluster", args=actualArgs,
packageName="qpid")
+
+ def leaveCluster(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"leaveCluster", args=actualArgs, packageName="qpid")
- def echo(self, model, callbackMethod, sequence, body):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "leaveCluster", args=actualArgs,
packageName="qpid")
+
+ def echo(self, model, managedBrokerLabel, callbackMethod, sequence, body):
actualArgs = dict()
actualArgs["sequence"] = sequence
actualArgs["body"] = body
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"echo", args=actualArgs, packageName="qpid")
- def crash(self, model, callbackMethod):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "echo", args=actualArgs,
packageName="qpid")
+
+ def crash(self, model, managedBrokerLabel, callbackMethod):
"""Temporary test method to crash the broker"""
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"crash", args=actualArgs, packageName="qpid")
- _SO_class_Mint_broker_stats = MintBrokerStats
- _SO_class_Mint_system = MintSystem
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "crash", args=actualArgs,
packageName="qpid")
-class MintVhostStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+class BrokerStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ broker = ForeignKey('Broker', cascade='null', default=None)
-MintSystem.sqlmeta.addJoin(MultipleJoin('MintBroker',
joinMethodName='brokers'))
+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)
+ broker = ForeignKey('Broker', cascade='null', default=None)
+ name = StringCol(length=1000, default=None)
-class MintVhost(SQLObject):
- schemaId = 3
- schemaName = "vhost"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- _SO_class_Mint_vhost_stats = MintVhostStats
- _SO_class_Mint_broker = MintBroker
+class VhostStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ vhost = ForeignKey('Vhost', cascade='null', default=None)
-class MintQueueStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+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)
+ vhost = ForeignKey('Vhost', cascade='null', default=None)
+ name = StringCol(length=1000, default=None)
+ durable = BoolCol(default=None)
+ autoDelete = BoolCol(default=None)
+ exclusive = BoolCol(default=None)
+ pageMemoryLimit = IntCol(default=None)
-MintBroker.sqlmeta.addJoin(MultipleJoin('MintVhost',
joinMethodName='vhosts'))
-
-class MintQueue(SQLObject):
- schemaId = 4
- schemaName = "queue"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- def purge(self, model, callbackMethod):
+ def purge(self, model, managedBrokerLabel, callbackMethod):
"""Discard all messages on queue"""
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"purge", args=actualArgs, packageName="qpid")
- def increaseDiskSize(self, model, callbackMethod, pages):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "purge", args=actualArgs,
packageName="qpid")
+
+ def increaseDiskSize(self, model, managedBrokerLabel, callbackMethod, pages):
"""Increase number of disk pages allocated for this
queue"""
actualArgs = dict()
actualArgs["pages"] = pages
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"increaseDiskSize", args=actualArgs, packageName="qpid")
- _SO_class_Mint_queue_stats = MintQueueStats
- _SO_class_Mint_vhost = MintVhost
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "increaseDiskSize",
args=actualArgs, packageName="qpid")
-class MintExchangeStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+class QueueStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ queue = ForeignKey('Queue', cascade='null', default=None)
+ diskPageSize = IntCol(default=None)
+ diskPages = IntCol(default=None)
+ diskAvailableSize = IntCol(default=None)
+ msgTotalEnqueues = BigIntCol(default=None)
+ msgTotalDequeues = BigIntCol(default=None)
+ msgTxnEnqueues = BigIntCol(default=None)
+ msgTxnDequeues = BigIntCol(default=None)
+ msgPersistEnqueues = BigIntCol(default=None)
+ msgPersistDequeues = BigIntCol(default=None)
+ msgDepth = IntCol(default=None)
+ msgDepthLow = IntCol(default=None)
+ msgDepthHigh = IntCol(default=None)
+ byteTotalEnqueues = BigIntCol(default=None)
+ byteTotalDequeues = BigIntCol(default=None)
+ byteTxnEnqueues = BigIntCol(default=None)
+ byteTxnDequeues = BigIntCol(default=None)
+ bytePersistEnqueues = BigIntCol(default=None)
+ bytePersistDequeues = BigIntCol(default=None)
+ byteDepth = IntCol(default=None)
+ byteDepthLow = IntCol(default=None)
+ byteDepthHigh = IntCol(default=None)
+ enqueueTxnStarts = BigIntCol(default=None)
+ enqueueTxnCommits = BigIntCol(default=None)
+ enqueueTxnRejects = BigIntCol(default=None)
+ enqueueTxnCount = IntCol(default=None)
+ enqueueTxnCountLow = IntCol(default=None)
+ enqueueTxnCountHigh = IntCol(default=None)
+ dequeueTxnStarts = BigIntCol(default=None)
+ dequeueTxnCommits = BigIntCol(default=None)
+ dequeueTxnRejects = BigIntCol(default=None)
+ dequeueTxnCount = IntCol(default=None)
+ dequeueTxnCountLow = IntCol(default=None)
+ dequeueTxnCountHigh = IntCol(default=None)
+ consumers = IntCol(default=None)
+ consumersLow = IntCol(default=None)
+ consumersHigh = IntCol(default=None)
+ bindings = IntCol(default=None)
+ bindingsLow = IntCol(default=None)
+ bindingsHigh = IntCol(default=None)
+ unackedMessages = IntCol(default=None)
+ unackedMessagesLow = IntCol(default=None)
+ unackedMessagesHigh = IntCol(default=None)
-MintVhost.sqlmeta.addJoin(MultipleJoin('MintQueue',
joinMethodName='queues'))
+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)
+ vhost = ForeignKey('Vhost', cascade='null', default=None)
+ name = StringCol(length=1000, default=None)
+ type = StringCol(length=1000, default=None)
-class MintExchange(SQLObject):
- schemaId = 5
- schemaName = "exchange"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- _SO_class_Mint_exchange_stats = MintExchangeStats
- _SO_class_Mint_vhost = MintVhost
+class ExchangeStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ exchange = ForeignKey('Exchange', cascade='null', default=None)
+ producers = IntCol(default=None)
+ producersLow = IntCol(default=None)
+ producersHigh = IntCol(default=None)
+ bindings = IntCol(default=None)
+ bindingsLow = IntCol(default=None)
+ bindingsHigh = IntCol(default=None)
+ msgReceives = BigIntCol(default=None)
+ msgDrops = BigIntCol(default=None)
+ msgRoutes = BigIntCol(default=None)
+ byteReceives = BigIntCol(default=None)
+ byteDrops = BigIntCol(default=None)
+ byteRoutes = BigIntCol(default=None)
-class MintBindingStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+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)
+ queue = ForeignKey('Queue', cascade='null', default=None)
+ exchange = ForeignKey('Exchange', cascade='null', default=None)
+ bindingKey = StringCol(length=1000, default=None)
-MintVhost.sqlmeta.addJoin(MultipleJoin('MintExchange',
joinMethodName='exchanges'))
+class BindingStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ binding = ForeignKey('Binding', cascade='null', default=None)
+ msgMatched = BigIntCol(default=None)
-class MintBinding(SQLObject):
- schemaId = 6
- schemaName = "binding"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- _SO_class_Mint_binding_stats = MintBindingStats
- _SO_class_Mint_queue = MintQueue
- _SO_class_Mint_exchange = MintExchange
+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)
+ vhost = ForeignKey('Vhost', cascade='null', default=None)
+ ipAddr = IntCol(default=None)
+ port = SmallIntCol(default=None)
-class MintClientStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
-
-MintQueue.sqlmeta.addJoin(MultipleJoin('MintBinding',
joinMethodName='bindings'))
-MintExchange.sqlmeta.addJoin(MultipleJoin('MintBinding',
joinMethodName='bindings'))
-
-class MintClient(SQLObject):
- schemaId = 7
- schemaName = "client"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- def close(self, model, callbackMethod):
+ def close(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"close", args=actualArgs, packageName="qpid")
- def detach(self, model, callbackMethod):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "close", args=actualArgs,
packageName="qpid")
+
+ def detach(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"detach", args=actualArgs, packageName="qpid")
- _SO_class_Mint_client_stats = MintClientStats
- _SO_class_Mint_vhost = MintVhost
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "detach", args=actualArgs,
packageName="qpid")
-class MintSessionStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+class ClientStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ client = ForeignKey('Client', cascade='null', default=None)
+ authIdentity = StringCol(length=1000, default=None)
+ msgsProduced = BigIntCol(default=None)
+ msgsConsumed = BigIntCol(default=None)
+ bytesProduced = BigIntCol(default=None)
+ bytesConsumed = BigIntCol(default=None)
-MintVhost.sqlmeta.addJoin(MultipleJoin('MintClient',
joinMethodName='clients'))
+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)
+ vhost = ForeignKey('Vhost', cascade='null', default=None)
+ name = StringCol(length=1000, default=None)
+ client = ForeignKey('Client', cascade='null', default=None)
+ detachedLifespan = IntCol(default=None)
-class MintSession(SQLObject):
- schemaId = 8
- schemaName = "session"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- def solicitAck(self, model, callbackMethod):
+ def solicitAck(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"solicitAck", args=actualArgs, packageName="qpid")
- def detach(self, model, callbackMethod):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "solicitAck", args=actualArgs,
packageName="qpid")
+
+ def detach(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"detach", args=actualArgs, packageName="qpid")
- def resetLifespan(self, model, callbackMethod):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "detach", args=actualArgs,
packageName="qpid")
+
+ def resetLifespan(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"resetLifespan", args=actualArgs, packageName="qpid")
- def close(self, model, callbackMethod):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "resetLifespan", args=actualArgs,
packageName="qpid")
+
+ def close(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"close", args=actualArgs, packageName="qpid")
- _SO_class_Mint_session_stats = MintSessionStats
- _SO_class_Mint_vhost = MintVhost
- _SO_class_Mint_client = MintClient
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "close", args=actualArgs,
packageName="qpid")
-class MintDestinationStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+class SessionStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ session = ForeignKey('Session', cascade='null', default=None)
+ attached = BoolCol(default=None)
+ remainingLifespan = IntCol(default=None)
+ framesOutstanding = IntCol(default=None)
-MintVhost.sqlmeta.addJoin(MultipleJoin('MintSession',
joinMethodName='sessions'))
-MintClient.sqlmeta.addJoin(MultipleJoin('MintSession',
joinMethodName='sessions'))
+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)
+ session = ForeignKey('Session', cascade='null', default=None)
+ name = StringCol(length=1000, default=None)
-class MintDestination(SQLObject):
- schemaId = 9
- schemaName = "destination"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- def throttle(self, model, callbackMethod, strength):
+ def throttle(self, model, managedBrokerLabel, callbackMethod, strength):
"""Apply extra rate limiting to destination: 0 = Normal, 10 =
Maximum"""
actualArgs = dict()
actualArgs["strength"] = strength
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"throttle", args=actualArgs, packageName="qpid")
- def stop(self, model, callbackMethod):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "throttle", args=actualArgs,
packageName="qpid")
+
+ def stop(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"stop", args=actualArgs, packageName="qpid")
- def start(self, model, callbackMethod):
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "stop", args=actualArgs,
packageName="qpid")
+
+ def start(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"start", args=actualArgs, packageName="qpid")
- _SO_class_Mint_destination_stats = MintDestinationStats
- _SO_class_Mint_session = MintSession
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "start", args=actualArgs,
packageName="qpid")
-class MintProducerStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+class DestinationStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ destination = ForeignKey('Destination', cascade='null', default=None)
+ flowMode = SmallIntCol(default=None)
+ maxMsgCredits = IntCol(default=None)
+ maxByteCredits = IntCol(default=None)
+ msgCredits = IntCol(default=None)
+ byteCredits = IntCol(default=None)
-MintSession.sqlmeta.addJoin(MultipleJoin('MintDestination',
joinMethodName='destinations'))
+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)
+ destination = ForeignKey('Destination', cascade='null', default=None)
+ exchange = ForeignKey('Exchange', cascade='null', default=None)
-class MintProducer(SQLObject):
- schemaId = 10
- schemaName = "producer"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- _SO_class_Mint_producer_stats = MintProducerStats
- _SO_class_Mint_destination = MintDestination
- _SO_class_Mint_exchange = MintExchange
+class ProducerStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ producer = ForeignKey('Producer', cascade='null', default=None)
+ msgsProduced = BigIntCol(default=None)
+ bytesProduced = BigIntCol(default=None)
-class MintConsumerStats(SQLObject):
- class sqlmeta:
- fromDatabase = True
+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)
+ destination = ForeignKey('Destination', cascade='null', default=None)
+ queue = ForeignKey('Queue', cascade='null', default=None)
-MintDestination.sqlmeta.addJoin(MultipleJoin('MintProducer',
joinMethodName='producers'))
-MintExchange.sqlmeta.addJoin(MultipleJoin('MintProducer',
joinMethodName='producers'))
-
-class MintConsumer(SQLObject):
- schemaId = 11
- schemaName = "consumer"
- managedBroker = None
- class sqlmeta:
- fromDatabase = True
- def close(self, model, callbackMethod):
+ def close(self, model, managedBrokerLabel, callbackMethod):
actualArgs = dict()
methodId = model.registerCallback(callbackMethod)
- self.managedBroker.method(methodId, self.idOriginal, self.schemaName,
"close", args=actualArgs, packageName="qpid")
- _SO_class_Mint_consumer_stats = MintConsumerStats
- _SO_class_Mint_destination = MintDestination
- _SO_class_Mint_queue = MintQueue
+ model.getConnectedBroker(managedBrokerLabel).method(methodId, self.idOriginal,
classToSchemaNameMap[self.__class__.__name__], "close", args=actualArgs,
packageName="qpid")
+
+class ConsumerStats(SQLObject):
+ idOriginal = BigIntCol(default=None)
+ recTime = TimestampCol(default=None)
+ consumer = ForeignKey('Consumer', cascade='null', default=None)
+ msgsConsumed = BigIntCol(default=None)
+ bytesConsumed = BigIntCol(default=None)
+ unackedMessages = IntCol(default=None)
+ unackedMessagesLow = IntCol(default=None)
+ unackedMessagesHigh = IntCol(default=None)
+
+classToSchemaNameMap = dict()
+classToSchemaNameMap['System'] = 'system'
+classToSchemaNameMap['Broker'] = 'broker'
+classToSchemaNameMap['Vhost'] = 'vhost'
+classToSchemaNameMap['Queue'] = 'queue'
+classToSchemaNameMap['Exchange'] = 'exchange'
+classToSchemaNameMap['Binding'] = 'binding'
+classToSchemaNameMap['Client'] = 'client'
+classToSchemaNameMap['Session'] = 'session'
+classToSchemaNameMap['Destination'] = 'destination'
+classToSchemaNameMap['Producer'] = 'producer'
+classToSchemaNameMap['Consumer'] = 'consumer'
Modified: mgmt/mint/python/mint/schema.sql
===================================================================
--- mgmt/mint/python/mint/schema.sql 2007-11-16 19:46:54 UTC (rev 1324)
+++ mgmt/mint/python/mint/schema.sql 2007-11-16 19:50:33 UTC (rev 1325)
@@ -1,332 +1,375 @@
+CREATE TABLE binding (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ queue_id INT,
+ exchange_id INT,
+ binding_key VARCHAR(1000)
+);
-CREATE TABLE mint_system (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_system_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- sys_ident VARCHAR(1000)
+CREATE TABLE binding_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ binding_id INT,
+ msg_matched BIGINT
);
-CREATE INDEX mint_system_sys_ident_index ON mint_system(sys_ident);
+CREATE TABLE broker (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ system_id INT,
+ port SMALLINT,
+ worker_threads SMALLINT,
+ max_conns SMALLINT,
+ conn_backlog SMALLINT,
+ staging_threshold INT,
+ store_lib VARCHAR(1000),
+ async_store BOOL,
+ mgmt_pub_interval SMALLINT,
+ initial_disk_page_size INT,
+ initial_pages_per_queue INT,
+ cluster_name VARCHAR(1000),
+ version VARCHAR(1000)
+);
-CREATE TABLE mint_system_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_system_id BIGINT REFERENCES mint_system ,
- rec_time TIMESTAMP
+CREATE TABLE broker_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ broker_id INT
);
-ALTER TABLE mint_system ADD FOREIGN KEY (mint_system_stats_id) REFERENCES
mint_system_stats;
+CREATE TABLE client (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ vhost_id INT,
+ ip_addr INT,
+ port SMALLINT
+);
-CREATE TABLE mint_broker (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_broker_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_system_id BIGINT REFERENCES mint_system,
- port INT2 ,
- worker_threads INT2 ,
- max_conns INT2 ,
- conn_backlog INT2 ,
- staging_threshold INT4 ,
- store_lib VARCHAR(1000) ,
- async_store BOOLEAN ,
- mgmt_pub_interval INT2 ,
- initial_disk_page_size INT4 ,
- initial_pages_per_queue INT4 ,
- cluster_name VARCHAR(1000) ,
- version VARCHAR(1000)
+CREATE TABLE client_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ client_id INT,
+ auth_identity VARCHAR(1000),
+ msgs_produced BIGINT,
+ msgs_consumed BIGINT,
+ bytes_produced BIGINT,
+ bytes_consumed BIGINT
);
-CREATE INDEX mint_broker_port_index ON mint_broker(port);
+CREATE TABLE consumer (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ destination_id INT,
+ queue_id INT
+);
-CREATE TABLE mint_broker_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_broker_id BIGINT REFERENCES mint_broker ,
- rec_time TIMESTAMP
+CREATE TABLE consumer_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ consumer_id INT,
+ msgs_consumed BIGINT,
+ bytes_consumed BIGINT,
+ unacked_messages INT,
+ unacked_messages_low INT,
+ unacked_messages_high INT
);
-ALTER TABLE mint_broker ADD FOREIGN KEY (mint_broker_stats_id) REFERENCES
mint_broker_stats;
+CREATE TABLE destination (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ session_id INT,
+ name VARCHAR(1000)
+);
-CREATE TABLE mint_vhost (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_vhost_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_broker_id BIGINT REFERENCES mint_broker,
- name VARCHAR(1000)
+CREATE TABLE destination_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ destination_id INT,
+ flow_mode SMALLINT,
+ max_msg_credits INT,
+ max_byte_credits INT,
+ msg_credits INT,
+ byte_credits INT
);
-CREATE INDEX mint_vhost_name_index ON mint_vhost(name);
+CREATE TABLE exchange (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ vhost_id INT,
+ name VARCHAR(1000),
+ type VARCHAR(1000)
+);
-CREATE TABLE mint_vhost_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_vhost_id BIGINT REFERENCES mint_vhost ,
- rec_time TIMESTAMP
+CREATE TABLE exchange_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ exchange_id INT,
+ producers INT,
+ producers_low INT,
+ producers_high INT,
+ bindings INT,
+ bindings_low INT,
+ bindings_high INT,
+ msg_receives BIGINT,
+ msg_drops BIGINT,
+ msg_routes BIGINT,
+ byte_receives BIGINT,
+ byte_drops BIGINT,
+ byte_routes BIGINT
);
-ALTER TABLE mint_vhost ADD FOREIGN KEY (mint_vhost_stats_id) REFERENCES
mint_vhost_stats;
+CREATE TABLE producer (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ destination_id INT,
+ exchange_id INT
+);
-CREATE TABLE mint_queue (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_queue_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_vhost_id BIGINT REFERENCES mint_vhost,
- name VARCHAR(1000) ,
- durable BOOLEAN ,
- auto_delete BOOLEAN ,
- exclusive BOOLEAN ,
- page_memory_limit INT4
+CREATE TABLE producer_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ producer_id INT,
+ msgs_produced BIGINT,
+ bytes_produced BIGINT
);
-CREATE INDEX mint_queue_name_index ON mint_queue(name);
+CREATE TABLE queue (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ vhost_id INT,
+ name VARCHAR(1000),
+ durable BOOL,
+ auto_delete BOOL,
+ exclusive BOOL,
+ page_memory_limit INT
+);
-CREATE TABLE mint_queue_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_queue_id BIGINT REFERENCES mint_queue ,
- rec_time TIMESTAMP,
- disk_page_size INT4 ,
- disk_pages INT4 ,
- disk_available_size INT4 ,
- msg_total_enqueues INT8 ,
- msg_total_dequeues INT8 ,
- msg_txn_enqueues INT8 ,
- msg_txn_dequeues INT8 ,
- msg_persist_enqueues INT8 ,
- msg_persist_dequeues INT8 ,
- msg_depth INT4 ,
- msg_depth_high INT4 ,
- msg_depth_low INT4 ,
- byte_total_enqueues INT8 ,
- byte_total_dequeues INT8 ,
- byte_txn_enqueues INT8 ,
- byte_txn_dequeues INT8 ,
- byte_persist_enqueues INT8 ,
- byte_persist_dequeues INT8 ,
- byte_depth INT4 ,
- byte_depth_high INT4 ,
- byte_depth_low INT4 ,
- enqueue_txn_starts INT8 ,
- enqueue_txn_commits INT8 ,
- enqueue_txn_rejects INT8 ,
- enqueue_txn_count INT4 ,
- enqueue_txn_count_high INT4 ,
- enqueue_txn_count_low INT4 ,
- dequeue_txn_starts INT8 ,
- dequeue_txn_commits INT8 ,
- dequeue_txn_rejects INT8 ,
- dequeue_txn_count INT4 ,
- dequeue_txn_count_high INT4 ,
- dequeue_txn_count_low INT4 ,
- consumers INT4 ,
- consumers_high INT4 ,
- consumers_low INT4 ,
- bindings INT4 ,
- bindings_high INT4 ,
- bindings_low INT4 ,
- unacked_messages INT4 ,
- unacked_messages_high INT4 ,
- unacked_messages_low INT4
+CREATE TABLE queue_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ queue_id INT,
+ disk_page_size INT,
+ disk_pages INT,
+ disk_available_size INT,
+ msg_total_enqueues BIGINT,
+ msg_total_dequeues BIGINT,
+ msg_txn_enqueues BIGINT,
+ msg_txn_dequeues BIGINT,
+ msg_persist_enqueues BIGINT,
+ msg_persist_dequeues BIGINT,
+ msg_depth INT,
+ msg_depth_low INT,
+ msg_depth_high INT,
+ byte_total_enqueues BIGINT,
+ byte_total_dequeues BIGINT,
+ byte_txn_enqueues BIGINT,
+ byte_txn_dequeues BIGINT,
+ byte_persist_enqueues BIGINT,
+ byte_persist_dequeues BIGINT,
+ byte_depth INT,
+ byte_depth_low INT,
+ byte_depth_high INT,
+ enqueue_txn_starts BIGINT,
+ enqueue_txn_commits BIGINT,
+ enqueue_txn_rejects BIGINT,
+ enqueue_txn_count INT,
+ enqueue_txn_count_low INT,
+ enqueue_txn_count_high INT,
+ dequeue_txn_starts BIGINT,
+ dequeue_txn_commits BIGINT,
+ dequeue_txn_rejects BIGINT,
+ dequeue_txn_count INT,
+ dequeue_txn_count_low INT,
+ dequeue_txn_count_high INT,
+ consumers INT,
+ consumers_low INT,
+ consumers_high INT,
+ bindings INT,
+ bindings_low INT,
+ bindings_high INT,
+ unacked_messages INT,
+ unacked_messages_low INT,
+ unacked_messages_high INT
);
-ALTER TABLE mint_queue ADD FOREIGN KEY (mint_queue_stats_id) REFERENCES
mint_queue_stats;
+CREATE TABLE session (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ vhost_id INT,
+ name VARCHAR(1000),
+ client_id INT,
+ detached_lifespan INT
+);
-CREATE TABLE mint_exchange (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_exchange_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_vhost_id BIGINT REFERENCES mint_vhost,
- name VARCHAR(1000) ,
- type VARCHAR(1000)
+CREATE TABLE session_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ session_id INT,
+ attached BOOL,
+ remaining_lifespan INT,
+ frames_outstanding INT
);
-CREATE INDEX mint_exchange_name_index ON mint_exchange(name);
+CREATE TABLE system (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ sys_id VARCHAR(1000)
+);
-CREATE TABLE mint_exchange_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_exchange_id BIGINT REFERENCES mint_exchange ,
- rec_time TIMESTAMP,
- producers INT4 ,
- producers_high INT4 ,
- producers_low INT4 ,
- bindings INT4 ,
- bindings_high INT4 ,
- bindings_low INT4 ,
- msg_receives INT8 ,
- msg_drops INT8 ,
- msg_routes INT8 ,
- byte_receives INT8 ,
- byte_drops INT8 ,
- byte_routes INT8
+CREATE TABLE system_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ system_id INT
);
-ALTER TABLE mint_exchange ADD FOREIGN KEY (mint_exchange_stats_id) REFERENCES
mint_exchange_stats;
-
-CREATE TABLE mint_binding (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_binding_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_queue_id BIGINT REFERENCES mint_queue,
- mint_exchange_id BIGINT REFERENCES mint_exchange,
- binding_key VARCHAR(1000)
+CREATE TABLE vhost (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_id INT,
+ broker_id INT,
+ name VARCHAR(1000)
);
-CREATE TABLE mint_binding_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_binding_id BIGINT REFERENCES mint_binding ,
- rec_time TIMESTAMP,
- msg_matched INT8
+CREATE TABLE vhost_stats (
+ id SERIAL PRIMARY KEY,
+ id_original BIGINT,
+ rec_time TIMESTAMP,
+ vhost_id INT
);
-ALTER TABLE mint_binding ADD FOREIGN KEY (mint_binding_stats_id) REFERENCES
mint_binding_stats;
+ALTER TABLE binding ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
binding_stats (id) ON DELETE SET NULL;
-CREATE TABLE mint_client (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_client_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_vhost_id BIGINT REFERENCES mint_vhost,
- ip_addr INT4 ,
- port INT2
-);
+ALTER TABLE binding ADD CONSTRAINT queue_id_exists FOREIGN KEY (queue_id) REFERENCES
queue (id) ON DELETE SET NULL;
-CREATE INDEX mint_client_ip_addr_index ON mint_client(ip_addr);
+ALTER TABLE binding ADD CONSTRAINT exchange_id_exists FOREIGN KEY (exchange_id)
REFERENCES exchange (id) ON DELETE SET NULL;
-CREATE INDEX mint_client_port_index ON mint_client(port);
+ALTER TABLE binding_stats ADD CONSTRAINT binding_id_exists FOREIGN KEY (binding_id)
REFERENCES binding (id) ON DELETE SET NULL;
-CREATE TABLE mint_client_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_client_id BIGINT REFERENCES mint_client ,
- rec_time TIMESTAMP,
- auth_identity VARCHAR(1000) ,
- msgs_produced INT8 ,
- msgs_consumed INT8 ,
- bytes_produced INT8 ,
- bytes_consumed INT8
-);
+ALTER TABLE broker ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
broker_stats (id) ON DELETE SET NULL;
-ALTER TABLE mint_client ADD FOREIGN KEY (mint_client_stats_id) REFERENCES
mint_client_stats;
+ALTER TABLE broker ADD CONSTRAINT system_id_exists FOREIGN KEY (system_id) REFERENCES
system (id) ON DELETE SET NULL;
-CREATE TABLE mint_session (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_session_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_vhost_id BIGINT REFERENCES mint_vhost,
- name VARCHAR(1000) ,
- mint_client_id BIGINT REFERENCES mint_client,
- detached_lifespan INT4
-);
+ALTER TABLE broker_stats ADD CONSTRAINT broker_id_exists FOREIGN KEY (broker_id)
REFERENCES broker (id) ON DELETE SET NULL;
-CREATE INDEX mint_session_name_index ON mint_session(name);
+ALTER TABLE client ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
client_stats (id) ON DELETE SET NULL;
-CREATE TABLE mint_session_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_session_id BIGINT REFERENCES mint_session ,
- rec_time TIMESTAMP,
- attached BOOLEAN ,
- remaining_lifespan INT4 ,
- frames_outstanding INT4
-);
+ALTER TABLE client ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES vhost
(id) ON DELETE SET NULL;
-ALTER TABLE mint_session ADD FOREIGN KEY (mint_session_stats_id) REFERENCES
mint_session_stats;
+ALTER TABLE client_stats ADD CONSTRAINT client_id_exists FOREIGN KEY (client_id)
REFERENCES client (id) ON DELETE SET NULL;
-CREATE TABLE mint_destination (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_destination_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_session_id BIGINT REFERENCES mint_session,
- name VARCHAR(1000)
-);
+ALTER TABLE consumer ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
consumer_stats (id) ON DELETE SET NULL;
-CREATE INDEX mint_destination_name_index ON mint_destination(name);
+ALTER TABLE consumer ADD CONSTRAINT destination_id_exists FOREIGN KEY (destination_id)
REFERENCES destination (id) ON DELETE SET NULL;
-CREATE TABLE mint_destination_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_destination_id BIGINT REFERENCES mint_destination ,
- rec_time TIMESTAMP,
- flow_mode INT2 ,
- max_msg_credits INT4 ,
- max_byte_credits INT4 ,
- msg_credits INT4 ,
- byte_credits INT4
-);
+ALTER TABLE consumer ADD CONSTRAINT queue_id_exists FOREIGN KEY (queue_id) REFERENCES
queue (id) ON DELETE SET NULL;
-ALTER TABLE mint_destination ADD FOREIGN KEY (mint_destination_stats_id) REFERENCES
mint_destination_stats;
+ALTER TABLE consumer_stats ADD CONSTRAINT consumer_id_exists FOREIGN KEY (consumer_id)
REFERENCES consumer (id) ON DELETE SET NULL;
-CREATE TABLE mint_producer (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_producer_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_destination_id BIGINT REFERENCES mint_destination,
- mint_exchange_id BIGINT REFERENCES mint_exchange
-);
+ALTER TABLE destination ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
destination_stats (id) ON DELETE SET NULL;
-CREATE TABLE mint_producer_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_producer_id BIGINT REFERENCES mint_producer ,
- rec_time TIMESTAMP,
- msgs_produced INT8 ,
- bytes_produced INT8
-);
+ALTER TABLE destination ADD CONSTRAINT session_id_exists FOREIGN KEY (session_id)
REFERENCES session (id) ON DELETE SET NULL;
-ALTER TABLE mint_producer ADD FOREIGN KEY (mint_producer_stats_id) REFERENCES
mint_producer_stats;
+ALTER TABLE destination_stats ADD CONSTRAINT destination_id_exists FOREIGN KEY
(destination_id) REFERENCES destination (id) ON DELETE SET NULL;
-CREATE TABLE mint_consumer (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_consumer_stats_id BIGINT,
- rec_time TIMESTAMP,
- creation_time TIMESTAMP,
- deletion_time TIMESTAMP,
- mint_destination_id BIGINT REFERENCES mint_destination,
- mint_queue_id BIGINT REFERENCES mint_queue
-);
+ALTER TABLE exchange ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
exchange_stats (id) ON DELETE SET NULL;
-CREATE TABLE mint_consumer_stats (
- id BIGSERIAL PRIMARY KEY,
- id_original BIGINT,
- mint_consumer_id BIGINT REFERENCES mint_consumer ,
- rec_time TIMESTAMP,
- msgs_consumed INT8 ,
- bytes_consumed INT8 ,
- unacked_messages INT4 ,
- unacked_messages_high INT4 ,
- unacked_messages_low INT4
-);
+ALTER TABLE exchange ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES
vhost (id) ON DELETE SET NULL;
-ALTER TABLE mint_consumer ADD FOREIGN KEY (mint_consumer_stats_id) REFERENCES
mint_consumer_stats;
+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 destination_id_exists FOREIGN KEY (destination_id)
REFERENCES destination (id) ON DELETE SET NULL;
+
+ALTER TABLE producer ADD CONSTRAINT exchange_id_exists FOREIGN KEY (exchange_id)
REFERENCES exchange (id) ON DELETE SET NULL;
+
+ALTER TABLE producer_stats ADD CONSTRAINT producer_id_exists FOREIGN KEY (producer_id)
REFERENCES producer (id) ON DELETE SET NULL;
+
+ALTER TABLE queue ADD CONSTRAINT stats_id_exists FOREIGN KEY (stats_id) REFERENCES
queue_stats (id) ON DELETE SET NULL;
+
+ALTER TABLE queue ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES vhost
(id) ON DELETE SET NULL;
+
+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 vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES
vhost (id) ON DELETE SET NULL;
+
+ALTER TABLE session ADD CONSTRAINT client_id_exists FOREIGN KEY (client_id) REFERENCES
client (id) ON DELETE SET NULL;
+
+ALTER TABLE session_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_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 broker_id_exists FOREIGN KEY (broker_id) REFERENCES
broker (id) ON DELETE SET NULL;
+
+ALTER TABLE vhost_stats ADD CONSTRAINT vhost_id_exists FOREIGN KEY (vhost_id) REFERENCES
vhost (id) ON DELETE SET NULL;
+