Author: justi9
Date: 2008-09-30 14:24:39 -0400 (Tue, 30 Sep 2008)
New Revision: 2556
Modified:
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/sql/schema.sql
Log:
Update the schema to include the collector
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-09-30 15:40:04 UTC (rev 2555)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-09-30 18:24:39 UTC (rev 2556)
@@ -16,6 +16,7 @@
statsCurr = ForeignKey('SlotStats', cascade='null', default=None)
statsPrev = ForeignKey('SlotStats', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
+ collector = ForeignKey('Collector', cascade='null', default=None)
AccountingGroup = StringCol(length=1000, default=None)
Arch = StringCol(length=1000, default=None)
CheckpointPlatform = StringCol(length=1000, default=None)
@@ -377,6 +378,36 @@
+class Collector(SQLObject):
+ class sqlmeta:
+ lazyUpdate = True
+
+ recTime = TimestampCol(default=None)
+ sourceScopeId = BigIntCol(default=None)
+ sourceObjectId = BigIntCol(default=None)
+ creationTime = TimestampCol(default=None)
+ deletionTime = TimestampCol(default=None)
+ managedBroker = StringCol(length=1000, default=None)
+ statsCurr = ForeignKey('CollectorStats', cascade='null', default=None)
+ statsPrev = ForeignKey('CollectorStats', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
+ CondorPlatform = StringCol(length=1000, default=None)
+ CondorVersion = StringCol(length=1000, default=None)
+ Name = StringCol(length=1000, default=None)
+ PublicNetworkIpAddr = StringCol(length=1000, default=None)
+
+
+class CollectorStats(SQLObject):
+ class sqlmeta:
+ lazyUpdate = True
+
+ recTime = TimestampCol(default=None)
+ collector = ForeignKey('Collector', cascade='null', default=None)
+ classInfos = dict() # brokerId => classInfo
+
+
+
+
class Acl(SQLObject):
class sqlmeta:
lazyUpdate = True
@@ -938,6 +969,7 @@
clientConnection = ForeignKey('ClientConnection', cascade='null',
default=None)
classInfos = dict() # brokerId => classInfo
closing = BoolCol(default=None)
+ federationLink = BoolCol(default=None)
authIdentity = StringCol(length=1000, default=None)
framesFromClient = BigIntCol(default=None)
framesToClient = BigIntCol(default=None)
@@ -1124,6 +1156,9 @@
classToSchemaNameMap['Slot'] = 'Slot'
schemaNameToClassMap['Slot'] = Slot
+Collector.sqlmeta.addJoin(SQLMultipleJoin('Slot',
joinMethodName='slots'))
+
+
Slot.sqlmeta.addJoin(SQLMultipleJoin('SlotStats',
joinMethodName='stats'))
classToSchemaNameMap['Job'] = 'Job'
@@ -1154,6 +1189,11 @@
Negotiator.sqlmeta.addJoin(SQLMultipleJoin('NegotiatorStats',
joinMethodName='stats'))
+classToSchemaNameMap['Collector'] = 'Collector'
+schemaNameToClassMap['Collector'] = Collector
+
+Collector.sqlmeta.addJoin(SQLMultipleJoin('CollectorStats',
joinMethodName='stats'))
+
classToSchemaNameMap['Acl'] = 'acl'
schemaNameToClassMap['acl'] = Acl
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2008-09-30 15:40:04 UTC (rev 2555)
+++ mgmt/trunk/mint/sql/schema.sql 2008-09-30 18:24:39 UTC (rev 2556)
@@ -217,6 +217,7 @@
rec_time TIMESTAMP,
client_connection_id INT,
closing BOOL,
+ federation_link BOOL,
auth_identity VARCHAR(1000),
frames_from_client BIGINT,
frames_to_client BIGINT,
@@ -249,6 +250,28 @@
cluster_id INT
);
+CREATE TABLE collector (
+ id SERIAL PRIMARY KEY,
+ rec_time TIMESTAMP,
+ source_scope_id BIGINT,
+ source_object_id BIGINT,
+ creation_time TIMESTAMP,
+ deletion_time TIMESTAMP,
+ managed_broker VARCHAR(1000),
+ stats_curr_id INT,
+ stats_prev_id INT,
+ condor_platform VARCHAR(1000),
+ condor_version VARCHAR(1000),
+ name VARCHAR(1000),
+ public_network_ip_addr VARCHAR(1000)
+);
+
+CREATE TABLE collector_stats (
+ id SERIAL PRIMARY KEY,
+ rec_time TIMESTAMP,
+ collector_id INT
+);
+
CREATE TABLE exchange (
id SERIAL PRIMARY KEY,
rec_time TIMESTAMP,
@@ -570,6 +593,7 @@
managed_broker VARCHAR(1000),
stats_curr_id INT,
stats_prev_id INT,
+ collector_id INT,
accounting_group VARCHAR(1000),
arch VARCHAR(1000),
checkpoint_platform VARCHAR(1000),
@@ -851,6 +875,12 @@
ALTER TABLE cluster_stats ADD CONSTRAINT cluster_id_exists FOREIGN KEY (cluster_id)
REFERENCES cluster (id) ON DELETE SET NULL;
+ALTER TABLE collector ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES collector_stats (id) ON DELETE SET NULL;
+
+ALTER TABLE collector ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES collector_stats (id) ON DELETE SET NULL;
+
+ALTER TABLE collector_stats ADD CONSTRAINT collector_id_exists FOREIGN KEY (collector_id)
REFERENCES collector (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;
@@ -919,6 +949,8 @@
ALTER TABLE slot ADD CONSTRAINT stats_prev_id_exists FOREIGN KEY (stats_prev_id)
REFERENCES slot_stats (id) ON DELETE SET NULL;
+ALTER TABLE slot ADD CONSTRAINT collector_id_exists FOREIGN KEY (collector_id) REFERENCES
collector (id) ON DELETE SET NULL;
+
ALTER TABLE slot_stats ADD CONSTRAINT slot_id_exists FOREIGN KEY (slot_id) REFERENCES
slot (id) ON DELETE SET NULL;
ALTER TABLE store ADD CONSTRAINT stats_curr_id_exists FOREIGN KEY (stats_curr_id)
REFERENCES store_stats (id) ON DELETE SET NULL;