Author: justi9
Date: 2008-12-12 16:53:21 -0500 (Fri, 12 Dec 2008)
New Revision: 2997
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/python/mint/schemaparser.py
mgmt/trunk/mint/sql/schema.sql
Log:
So deletes aren't horribly slow, index the stats pointers
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-12-12 20:43:26 UTC (rev 2996)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-12-12 21:53:21 UTC (rev 2997)
@@ -16,13 +16,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('SlotStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('SlotStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
Pool = StringCol(length=1000, default=None)
System = StringCol(length=1000, default=None)
@@ -137,13 +139,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('JobStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('JobStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
scheduler = ForeignKey('Scheduler', cascade='null', default=None)
submitter = ForeignKey('Submitter', cascade='null', default=None)
@@ -249,13 +253,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('SchedulerStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('SchedulerStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
Pool = StringCol(length=1000, default=None)
System = StringCol(length=1000, default=None)
@@ -302,13 +308,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('SubmitterStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('SubmitterStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
scheduler = ForeignKey('Scheduler', cascade='null', default=None)
JobQueueBirthdate = TimestampCol(default=None)
@@ -338,13 +346,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('NegotiatorStats', cascade='null',
default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('NegotiatorStats', cascade='null',
default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
Pool = StringCol(length=1000, default=None)
System = StringCol(length=1000, default=None)
@@ -406,13 +416,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('CollectorStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('CollectorStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
Pool = StringCol(length=1000, default=None)
System = StringCol(length=1000, default=None)
@@ -440,13 +452,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('MasterStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('MasterStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
Pool = StringCol(length=1000, default=None)
System = StringCol(length=1000, default=None)
@@ -502,13 +516,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('AclStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('AclStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
broker = ForeignKey('Broker', cascade='null', default=None)
policyFile = StringCol(length=1000, default=None)
@@ -543,13 +559,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('ClusterStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('ClusterStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
broker = ForeignKey('Broker', cascade='null', default=None)
clusterName = StringCol(length=1000, default=None)
@@ -590,13 +608,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('StoreStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('StoreStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
broker = ForeignKey('Broker', cascade='null', default=None)
location = StringCol(length=1000, default=None)
@@ -638,13 +658,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('JournalStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('JournalStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
queue = ForeignKey('Queue', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -714,13 +736,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('SystemStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('SystemStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
systemId = BLOBCol(default=None)
osName = StringCol(length=1000, default=None)
@@ -748,13 +772,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('BrokerStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('BrokerStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
system = ForeignKey('System', cascade='null', default=None)
port = BigIntCol(default=None)
@@ -830,13 +856,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('AgentStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('AgentStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
clientConnection = ForeignKey('ClientConnection', cascade='null',
default=None)
label = StringCol(length=1000, default=None)
@@ -864,13 +892,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('VhostStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('VhostStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
broker = ForeignKey('Broker', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -895,13 +925,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('QueueStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('QueueStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -965,13 +997,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('ExchangeStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('ExchangeStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -1010,13 +1044,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('BindingStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('BindingStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
exchange = ForeignKey('Exchange', cascade='null', default=None)
queue = ForeignKey('Queue', cascade='null', default=None)
@@ -1044,13 +1080,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('ClientConnectionStats', cascade='null',
default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('ClientConnectionStats', cascade='null',
default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
address = StringCol(length=1000, default=None)
@@ -1089,13 +1127,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('LinkStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('LinkStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
host = StringCol(length=1000, default=None)
@@ -1155,13 +1195,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('BridgeStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('BridgeStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
link = ForeignKey('Link', cascade='null', default=None)
channelId = IntCol(default=None)
@@ -1200,13 +1242,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('SessionStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('SessionStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
vhost = ForeignKey('Vhost', cascade='null', default=None)
name = StringCol(length=1000, default=None)
@@ -1264,13 +1308,15 @@
qmfBrokerId = StringCol(length=1000, default=None)
qmfScopeId = BigIntCol(default=None)
qmfObjectId = BigIntCol(default=None)
- qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
+ qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId, qmfObjectId, unique=True)
qmfClassKey = StringCol(length=1000, default=None)
qmfUpdateTime = TimestampCol(default=None)
qmfCreateTime = TimestampCol(default=None)
qmfDeleteTime = TimestampCol(default=None)
statsCurr = ForeignKey('SysimageStats', cascade='null', default=None)
+ statsCurrIndex = DatabaseIndex(statsCurr)
statsPrev = ForeignKey('SysimageStats', cascade='null', default=None)
+ statsPrevIndex = DatabaseIndex(statsPrev)
classInfos = dict() # brokerId => classInfo
uuid = BLOBCol(default=None)
osName = StringCol(length=1000, default=None)
@@ -1351,16 +1397,16 @@
Master.sqlmeta.addJoin(SQLMultipleJoin('MasterStats',
joinMethodName='stats'))
-classToSchemaNameMap['Acl'] = 'Acl'
-schemaNameToClassMap['Acl'] = Acl
+classToSchemaNameMap['Acl'] = 'acl'
+schemaNameToClassMap['acl'] = Acl
Broker.sqlmeta.addJoin(SQLMultipleJoin('Acl', joinMethodName='acls'))
Acl.sqlmeta.addJoin(SQLMultipleJoin('AclStats', joinMethodName='stats'))
-classToSchemaNameMap['Cluster'] = 'Cluster'
-schemaNameToClassMap['Cluster'] = Cluster
+classToSchemaNameMap['Cluster'] = 'cluster'
+schemaNameToClassMap['cluster'] = Cluster
Broker.sqlmeta.addJoin(SQLMultipleJoin('Cluster',
joinMethodName='clusters'))
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-12-12 20:43:26 UTC (rev 2996)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-12-12 21:53:21 UTC (rev 2997)
@@ -73,6 +73,11 @@
params = "'%s', cascade='null'" % (reference)
name = self.renameReservedWord(name)
self.generateAttrib(name, "ForeignKey", params)
+
+ def generateForeignKeyAttribWithIndex(self, name, reference):
+ self.generateForeignKeyAttrib(name, reference)
+ name = self.renameReservedWord(name)
+ self.pythonOutput += " %sIndex = DatabaseIndex(%s)\n" % (name, name)
def generateHiLoAttrib(self, name, type):
self.generateAttrib(name, type)
@@ -95,7 +100,7 @@
self.pythonOutput += " lazyUpdate = %s\n\n" % (lazyUpdate)
def generateQmfIdsIndex(self, className):
- self.pythonOutput += " qmf_ids_unique = DatabaseIndex(qmfBrokerId, qmfScopeId,
qmfObjectId, unique=True)\n"
+ self.pythonOutput += " qmfIdsUnique = DatabaseIndex(qmfBrokerId, qmfScopeId,
qmfObjectId, unique=True)\n"
def generateClassAttribs(self, schemaName, elements):
if (schemaName == "JournalStats"):
@@ -160,10 +165,11 @@
self.generateTimestampAttrib("Update")
self.generateTimestampAttrib("Create")
self.generateTimestampAttrib("Delete")
- self.generateForeignKeyAttrib("statsCurr", statsPythonName)
- self.generateForeignKeyAttrib("statsPrev", statsPythonName)
+ self.generateForeignKeyAttribWithIndex("statsCurr", statsPythonName)
+ self.generateForeignKeyAttribWithIndex("statsPrev", statsPythonName)
self.finalPythonOutput += "classToSchemaNameMap['%s'] =
'%s'\n" % (pythonName, schemaName)
self.finalPythonOutput += "schemaNameToClassMap['%s'] = %s\n" %
(schemaName, pythonName)
+ # XXX get rid of this
self.pythonOutput += " classInfos = dict() # brokerId => classInfo\n"
def generateMethod(self, elem):
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2008-12-12 20:43:26 UTC (rev 2996)
+++ mgmt/trunk/mint/sql/schema.sql 2008-12-12 21:53:21 UTC (rev 2997)
@@ -79,7 +79,9 @@
transfer_acl BOOL,
last_acl_load TIMESTAMP
);
-CREATE UNIQUE INDEX acl_qmf_ids_unique ON acl (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX acl_qmfIdsUnique ON acl (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX acl_statsPrevIndex ON acl (stats_prev_id);
+CREATE INDEX acl_statsCurrIndex ON acl (stats_curr_id);
CREATE TABLE acl_stats (
id SERIAL PRIMARY KEY,
@@ -106,7 +108,9 @@
broker_bank BIGINT,
agent_bank BIGINT
);
-CREATE UNIQUE INDEX agent_qmf_ids_unique ON agent (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX agent_qmfIdsUnique ON agent (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX agent_statsPrevIndex ON agent (stats_prev_id);
+CREATE INDEX agent_statsCurrIndex ON agent (stats_curr_id);
CREATE TABLE agent_stats (
id SERIAL PRIMARY KEY,
@@ -131,7 +135,9 @@
arguments BYTEA,
origin VARCHAR(1000)
);
-CREATE UNIQUE INDEX binding_qmf_ids_unique ON binding (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX binding_qmfIdsUnique ON binding (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX binding_statsPrevIndex ON binding (stats_prev_id);
+CREATE INDEX binding_statsCurrIndex ON binding (stats_curr_id);
CREATE TABLE binding_stats (
id SERIAL PRIMARY KEY,
@@ -163,7 +169,9 @@
excludes VARCHAR(1000),
dynamic BOOL
);
-CREATE UNIQUE INDEX bridge_qmf_ids_unique ON bridge (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX bridge_qmfIdsUnique ON bridge (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX bridge_statsCurrIndex ON bridge (stats_curr_id);
+CREATE INDEX bridge_statsPrevIndex ON bridge (stats_prev_id);
CREATE TABLE bridge_stats (
id SERIAL PRIMARY KEY,
@@ -193,7 +201,9 @@
data_dir VARCHAR(1000),
registration_id INT
);
-CREATE UNIQUE INDEX broker_qmf_ids_unique ON broker (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX broker_qmfIdsUnique ON broker (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX broker_statsCurrIndex ON broker (stats_curr_id);
+CREATE INDEX broker_statsPrevIndex ON broker (stats_prev_id);
CREATE TABLE broker_stats (
id SERIAL PRIMARY KEY,
@@ -219,7 +229,9 @@
federation_link BOOL,
auth_identity VARCHAR(1000)
);
-CREATE UNIQUE INDEX client_connection_qmf_ids_unique ON client_connection (qmf_broker_id,
qmf_scope_id, qmf_object_id);
+CREATE UNIQUE INDEX client_connection_qmfIdsUnique ON client_connection (qmf_broker_id,
qmf_scope_id, qmf_object_id);
+CREATE INDEX client_connection_statsCurrIndex ON client_connection (stats_curr_id);
+CREATE INDEX client_connection_statsPrevIndex ON client_connection (stats_prev_id);
CREATE TABLE client_connection_stats (
id SERIAL PRIMARY KEY,
@@ -251,7 +263,9 @@
status VARCHAR(1000),
members VARCHAR(4000)
);
-CREATE UNIQUE INDEX cluster_qmf_ids_unique ON cluster (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX cluster_qmfIdsUnique ON cluster (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX cluster_statsCurrIndex ON cluster (stats_curr_id);
+CREATE INDEX cluster_statsPrevIndex ON cluster (stats_prev_id);
CREATE TABLE cluster_stats (
id SERIAL PRIMARY KEY,
@@ -277,7 +291,9 @@
name VARCHAR(1000),
public_network_ip_addr VARCHAR(1000)
);
-CREATE UNIQUE INDEX collector_qmf_ids_unique ON collector (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX collector_qmfIdsUnique ON collector (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX collector_statsPrevIndex ON collector (stats_prev_id);
+CREATE INDEX collector_statsCurrIndex ON collector (stats_curr_id);
CREATE TABLE collector_stats (
id SERIAL PRIMARY KEY,
@@ -302,7 +318,9 @@
durable BOOL,
arguments BYTEA
);
-CREATE UNIQUE INDEX exchange_qmf_ids_unique ON exchange (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX exchange_qmfIdsUnique ON exchange (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX exchange_statsPrevIndex ON exchange (stats_prev_id);
+CREATE INDEX exchange_statsCurrIndex ON exchange (stats_curr_id);
CREATE TABLE exchange_stats (
id SERIAL PRIMARY KEY,
@@ -362,7 +380,9 @@
dag_man_job_id BIGINT,
ad BYTEA
);
-CREATE UNIQUE INDEX job_qmf_ids_unique ON job (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX job_qmfIdsUnique ON job (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX job_statsPrevIndex ON job (stats_prev_id);
+CREATE INDEX job_statsCurrIndex ON job (stats_curr_id);
CREATE TABLE job_stats (
id SERIAL PRIMARY KEY,
@@ -393,7 +413,9 @@
data_file_size BIGINT,
current_file_count BIGINT
);
-CREATE UNIQUE INDEX journal_qmf_ids_unique ON journal (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX journal_qmfIdsUnique ON journal (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX journal_statsPrevIndex ON journal (stats_prev_id);
+CREATE INDEX journal_statsCurrIndex ON journal (stats_curr_id);
CREATE TABLE journal_stats (
id SERIAL PRIMARY KEY,
@@ -446,7 +468,9 @@
transport VARCHAR(1000),
durable BOOL
);
-CREATE UNIQUE INDEX link_qmf_ids_unique ON link (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX link_qmfIdsUnique ON link (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX link_statsCurrIndex ON link (stats_curr_id);
+CREATE INDEX link_statsPrevIndex ON link (stats_prev_id);
CREATE TABLE link_stats (
id SERIAL PRIMARY KEY,
@@ -478,7 +502,9 @@
condor_version VARCHAR(1000),
daemon_start_time TIMESTAMP
);
-CREATE UNIQUE INDEX master_qmf_ids_unique ON master (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX master_qmfIdsUnique ON master (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX master_statsCurrIndex ON master (stats_curr_id);
+CREATE INDEX master_statsPrevIndex ON master (stats_prev_id);
CREATE TABLE master_stats (
id SERIAL PRIMARY KEY,
@@ -512,7 +538,9 @@
condor_version VARCHAR(1000),
daemon_start_time TIMESTAMP
);
-CREATE UNIQUE INDEX negotiator_qmf_ids_unique ON negotiator (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX negotiator_qmfIdsUnique ON negotiator (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX negotiator_statsPrevIndex ON negotiator (stats_prev_id);
+CREATE INDEX negotiator_statsCurrIndex ON negotiator (stats_curr_id);
CREATE TABLE negotiator_stats (
id SERIAL PRIMARY KEY,
@@ -549,7 +577,9 @@
exclusive BOOL,
arguments BYTEA
);
-CREATE UNIQUE INDEX queue_qmf_ids_unique ON queue (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX queue_qmfIdsUnique ON queue (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX queue_statsCurrIndex ON queue (stats_curr_id);
+CREATE INDEX queue_statsPrevIndex ON queue (stats_prev_id);
CREATE TABLE queue_stats (
id SERIAL PRIMARY KEY,
@@ -607,7 +637,9 @@
condor_version VARCHAR(1000),
daemon_start_time TIMESTAMP
);
-CREATE UNIQUE INDEX scheduler_qmf_ids_unique ON scheduler (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX scheduler_qmfIdsUnique ON scheduler (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX scheduler_statsCurrIndex ON scheduler (stats_curr_id);
+CREATE INDEX scheduler_statsPrevIndex ON scheduler (stats_prev_id);
CREATE TABLE scheduler_stats (
id SERIAL PRIMARY KEY,
@@ -646,7 +678,9 @@
attached BOOL,
expire_time TIMESTAMP
);
-CREATE UNIQUE INDEX session_qmf_ids_unique ON session (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX session_qmfIdsUnique ON session (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX session_statsCurrIndex ON session (stats_curr_id);
+CREATE INDEX session_statsPrevIndex ON session (stats_prev_id);
CREATE TABLE session_stats (
id SERIAL PRIMARY KEY,
@@ -724,7 +758,9 @@
condor_version VARCHAR(1000),
daemon_start_time TIMESTAMP
);
-CREATE UNIQUE INDEX slot_qmf_ids_unique ON slot (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX slot_qmfIdsUnique ON slot (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX slot_statsCurrIndex ON slot (stats_curr_id);
+CREATE INDEX slot_statsPrevIndex ON slot (stats_prev_id);
CREATE TABLE slot_stats (
id SERIAL PRIMARY KEY,
@@ -793,7 +829,9 @@
tpl_data_file_size BIGINT,
tpl_current_file_count BIGINT
);
-CREATE UNIQUE INDEX store_qmf_ids_unique ON store (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX store_qmfIdsUnique ON store (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX store_statsCurrIndex ON store (stats_curr_id);
+CREATE INDEX store_statsPrevIndex ON store (stats_prev_id);
CREATE TABLE store_stats (
id SERIAL PRIMARY KEY,
@@ -827,7 +865,9 @@
name VARCHAR(1000),
schedd_name VARCHAR(1000)
);
-CREATE UNIQUE INDEX submitter_qmf_ids_unique ON submitter (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX submitter_qmfIdsUnique ON submitter (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX submitter_statsPrevIndex ON submitter (stats_prev_id);
+CREATE INDEX submitter_statsCurrIndex ON submitter (stats_curr_id);
CREATE TABLE submitter_stats (
id SERIAL PRIMARY KEY,
@@ -858,7 +898,9 @@
mem_total BIGINT,
swap_total BIGINT
);
-CREATE UNIQUE INDEX sysimage_qmf_ids_unique ON sysimage (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX sysimage_qmfIdsUnique ON sysimage (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX sysimage_statsPrevIndex ON sysimage (stats_prev_id);
+CREATE INDEX sysimage_statsCurrIndex ON sysimage (stats_curr_id);
CREATE TABLE sysimage_stats (
id SERIAL PRIMARY KEY,
@@ -891,7 +933,9 @@
version VARCHAR(1000),
machine VARCHAR(1000)
);
-CREATE UNIQUE INDEX system_qmf_ids_unique ON system (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX system_qmfIdsUnique ON system (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX system_statsPrevIndex ON system (stats_prev_id);
+CREATE INDEX system_statsCurrIndex ON system (stats_curr_id);
CREATE TABLE system_stats (
id SERIAL PRIMARY KEY,
@@ -914,7 +958,9 @@
name VARCHAR(1000),
federation_tag VARCHAR(1000)
);
-CREATE UNIQUE INDEX vhost_qmf_ids_unique ON vhost (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE UNIQUE INDEX vhost_qmfIdsUnique ON vhost (qmf_broker_id, qmf_scope_id,
qmf_object_id);
+CREATE INDEX vhost_statsPrevIndex ON vhost (stats_prev_id);
+CREATE INDEX vhost_statsCurrIndex ON vhost (stats_curr_id);
CREATE TABLE vhost_stats (
id SERIAL PRIMARY KEY,