Author: nunofsantos
Date: 2008-07-08 14:21:48 -0400 (Tue, 08 Jul 2008)
New Revision: 2182
Modified:
mgmt/trunk/mint/python/mint/__init__.py
mgmt/trunk/mint/python/mint/schema.py
mgmt/trunk/mint/python/mint/schemaparser.py
mgmt/trunk/mint/sql/schema.sql
Log:
BZ 454362: Mint broker port datatype is too small - forcing next size up to accomodate
unsigned value
Modified: mgmt/trunk/mint/python/mint/__init__.py
===================================================================
--- mgmt/trunk/mint/python/mint/__init__.py 2008-07-08 16:16:08 UTC (rev 2181)
+++ mgmt/trunk/mint/python/mint/__init__.py 2008-07-08 18:21:48 UTC (rev 2182)
@@ -40,7 +40,7 @@
name = StringCol(length=1000, default=None, unique=True, notNone=True)
host = StringCol(length=1000, default=None, notNone=True)
- port = SmallIntCol(default=None, notNone=True)
+ port = IntCol(default=None, notNone=True)
broker = ForeignKey("Broker", cascade="null", default=None)
groups = SQLRelatedJoin("BrokerGroup",
intermediateTable="broker_group_mapping",
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-07-08 16:16:08 UTC (rev 2181)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-07-08 18:21:48 UTC (rev 2182)
@@ -47,7 +47,7 @@
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)
+ port = IntCol(default=None)
workerThreads = SmallIntCol(default=None)
maxConns = SmallIntCol(default=None)
connBacklog = SmallIntCol(default=None)
@@ -195,7 +195,7 @@
durable = BoolCol(default=None)
autoDelete = BoolCol(default=None)
exclusive = BoolCol(default=None)
- arguments = StringCol(length=4000, default=None)
+ arguments = StringCol(default=None)
classInfos = dict() # brokerId => classInfo
@@ -235,14 +235,10 @@
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)
consumerCount = IntCol(default=None)
consumerCountLow = IntCol(default=None)
consumerCountHigh = IntCol(default=None)
@@ -322,7 +318,7 @@
exchange = ForeignKey('Exchange', cascade='null', default=None)
queue = ForeignKey('Queue', cascade='null', default=None)
bindingKey = StringCol(length=1000, default=None)
- arguments = StringCol(length=4000, default=None)
+ arguments = StringCol(default=None)
classInfos = dict() # brokerId => classInfo
@@ -404,7 +400,7 @@
statsPrev = ForeignKey('LinkStats', cascade='null', default=None)
vhost = ForeignKey('Vhost', cascade='null', default=None)
host = StringCol(length=1000, default=None)
- port = SmallIntCol(default=None)
+ port = IntCol(default=None)
useSsl = BoolCol(default=None)
durable = BoolCol(default=None)
Modified: mgmt/trunk/mint/python/mint/schemaparser.py
===================================================================
--- mgmt/trunk/mint/python/mint/schemaparser.py 2008-07-08 16:16:08 UTC (rev 2181)
+++ mgmt/trunk/mint/python/mint/schemaparser.py 2008-07-08 18:21:48 UTC (rev 2182)
@@ -35,7 +35,7 @@
self.dataTypesMap["absTime"] = self.dataTypesMap["deltaTime"] =
"BigIntCol"
self.dataTypesMap["bool"] = "BoolCol"
self.dataTypesMap["sstr"] = self.dataTypesMap["lstr"] =
"StringCol"
- self.dataTypesMap["ftable"] = "StringCol"
+ self.dataTypesMap["map"] = "StringCol"
def attrNameFromDbColumn(self, name, removeSuffix=""):
return self.style.dbColumnToPythonAttr(name.replace(removeSuffix, ""))
@@ -48,6 +48,10 @@
params += ", default=None"
if attribName == "id":
attribName = "id_"
+ # special case for "port" attrib, needs to be a 2-byte unsigned
+ # but uint16 converts to a signed int (SmallIntCol), so forcing the next size up
(IntCol)
+ if (attribName == "port" and attribType ==
self.dataTypesMap["uint16"]):
+ attribType = self.dataTypesMap["uint32"]
self.pythonOutput += " %s = %s(%s)\n" % (attribName, attribType, params)
def generateTimestampAttrib(self, col):
Modified: mgmt/trunk/mint/sql/schema.sql
===================================================================
--- mgmt/trunk/mint/sql/schema.sql 2008-07-08 16:16:08 UTC (rev 2181)
+++ mgmt/trunk/mint/sql/schema.sql 2008-07-08 18:21:48 UTC (rev 2182)
@@ -24,7 +24,7 @@
id SERIAL PRIMARY KEY,
name VARCHAR(1000) NOT NULL UNIQUE,
host VARCHAR(1000) NOT NULL,
- port SMALLINT NOT NULL,
+ port INT NOT NULL,
broker_id INT,
cluster_id INT,
profile_id INT
@@ -85,7 +85,7 @@
exchange_id INT,
queue_id INT,
binding_key VARCHAR(1000),
- arguments VARCHAR(4000)
+ arguments TEXT
);
CREATE TABLE binding_stats (
@@ -134,7 +134,7 @@
stats_curr_id INT,
stats_prev_id INT,
system_id INT,
- port SMALLINT,
+ port INT,
worker_threads SMALLINT,
max_conns SMALLINT,
conn_backlog SMALLINT,
@@ -279,7 +279,7 @@
stats_prev_id INT,
vhost_id INT,
host VARCHAR(1000),
- port SMALLINT,
+ port INT,
use_ssl BOOL,
durable BOOL
);
@@ -307,7 +307,7 @@
durable BOOL,
auto_delete BOOL,
exclusive BOOL,
- arguments VARCHAR(4000)
+ arguments TEXT
);
CREATE TABLE queue_stats (
@@ -333,14 +333,10 @@
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,
consumer_count INT,
consumer_count_low INT,
consumer_count_high INT,