rhmessaging commits: r1838 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-04 11:13:52 -0400 (Fri, 04 Apr 2008)
New Revision: 1838
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/stat.py
Log:
Add all the remaining properties to the ui metadata for mgmt defined
objects.
Avoid a name collision by renameing CuminClass.name to
CuminClass.cumin_name.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-04 13:44:32 UTC (rev 1837)
+++ mgmt/cumin/python/cumin/model.py 2008-04-04 15:13:52 UTC (rev 1838)
@@ -38,7 +38,7 @@
def add_class(self, cls):
self.classes.append(cls)
- setattr(self, cls.name, cls)
+ setattr(self, cls.cumin_name, cls)
def get_class_by_object(self, mint_object):
for cls in self.classes:
@@ -279,7 +279,7 @@
class CuminClass(object):
def __init__(self, model, name, mint_class):
self.model = model
- self.name = name
+ self.cumin_name = name
self.mint_class = mint_class
self.properties = list()
@@ -431,6 +431,36 @@
def __init__(self, model):
super(CuminBroker, self).__init__(model, "broker", Broker, BrokerStats)
+ prop = CuminProperty(self, "port")
+ prop.title = "Port"
+
+ prop = CuminProperty(self, "workerThreads")
+ prop.title = "Worker Threads"
+
+ prop = CuminProperty(self, "maxConns")
+ prop.title = "Max Connections"
+
+ prop = CuminProperty(self, "connBacklog")
+ prop.title = "Connection Backlog"
+
+ prop = CuminProperty(self, "stagingThreshold")
+ prop.title = "Staging Threshold"
+
+ prop = CuminProperty(self, "mgmtPubInterval")
+ prop.title = "Mgmt. Publish Interval"
+
+ prop = CuminProperty(self, "clusterName")
+ prop.title = "Cluster Name"
+
+ prop = CuminProperty(self, "version")
+ prop.title = "Version"
+
+ prop = CuminProperty(self, "dataDirEnabled")
+ prop.title = "Data Dir. Enabled?"
+
+ prop = CuminProperty(self, "dataDir")
+ prop.title = "Data Directory"
+
def show(self, session, broker):
frame = self.model.app.main_page.show_main(session)
return frame.show_broker(session, broker)
@@ -439,86 +469,98 @@
def __init__(self, model):
super(CuminQueue, self).__init__(model, "queue", Queue, QueueStats)
+ prop = CuminProperty(self, "name")
+ prop.title = "Name"
+
+ prop = CuminProperty(self, "durable")
+ prop.title = "Durable?"
+
+ prop = CuminProperty(self, "autoDelete")
+ prop.title = "Auto Delete?"
+
+ prop = CuminProperty(self, "exclusive")
+ prop.title = "Exclusive?"
+
stat = CuminStat(self, "consumers")
stat.title = "Consumers"
stat.unit = "consumer"
- stat.categories = ("general")
+ stat.categories = ("general",)
stat.highlow = True
stat = CuminStat(self, "bindings")
stat.title = "Bindings"
stat.unit = "binding"
- stat.categories = ("general")
+ stat.categories = ("general",)
stat.highlow = True
stat = CuminStat(self, "msgDepth")
stat.title = "Message Depth"
stat.unit = "message"
- stat.categories = ("message", "general")
+ stat.categories = ("general",)
stat.highlow = True
stat = CuminStat(self, "msgTotalEnqueues")
stat.title = "Msgs. Enqueued"
stat.unit = "message"
- stat.categories = ("message", "general")
+ stat.categories = ("general",)
stat = CuminStat(self, "msgTotalDequeues")
stat.title = "Msgs. Dequeued"
stat.unit = "message"
- stat.categories = ("message", "general")
+ stat.categories = ("general",)
stat = CuminStat(self, "byteDepth")
stat.title = "Byte Depth"
stat.unit = "byte"
- stat.categories = ("byte", "general")
+ stat.categories = ("general",)
stat.highlow = True
stat = CuminStat(self, "byteTotalEnqueues")
stat.title = "Bytes Enqueued"
stat.unit = "byte"
- stat.categories = ("byte", "general")
+ stat.categories = ("general",)
stat = CuminStat(self, "byteTotalDequeues")
stat.title = "Bytes Dequeued"
stat.unit = "byte"
- stat.categories = ("byte", "general")
+ stat.categories = ("general",)
stat = CuminStat(self, "unackedMessages")
stat.title = "Msgs. Unacked"
stat.unit = "message"
- stat.categories = ("general")
+ stat.categories = ("general",)
stat.highlow = True
stat = CuminStat(self, "messageLatencyMin")
stat.title = "Min. Msg. Latency"
stat.unit = "nanosecond"
- stat.categories = ("general")
+ stat.categories = ("general",)
stat = CuminStat(self, "messageLatencyMax")
stat.title = "Max. Msg. Latency"
stat.unit = "nanosecond"
- stat.categories = ("general")
+ stat.categories = ("general",)
stat = CuminStat(self, "messageLatencyAverage")
stat.title = "Avg. Msg. Latency"
stat.unit = "nanosecond"
- stat.categories = ("general")
+ stat.categories = ("general",)
stat = CuminStat(self, "messageLatencySamples")
stat.title = "Msg. Latency Samples"
stat.unit = "sample"
- stat.categories = ("general")
+ stat.categories = ("general",)
# Disk
#stat = CuminStat(self, "diskPageSize")
#stat.title = "Page size"
- #stat.categories = ("disk")
+ #stat.categories = ("disk",)
#stat = CuminStat(self, "diskPages")
#stat.title = "Disk Pages"
#stat.unit = "page"
- #stat.categories = ("general")
+ #stat.categories = ("general",)
#stat = CuminStat(self, "diskAvailableSize")
#stat.title = "Available size"
@@ -627,6 +669,12 @@
super(CuminExchange, self).__init__(model, "exchange",
Exchange, ExchangeStats)
+ prop = CuminProperty(self, "name")
+ prop.title = "Name"
+
+ prop = CuminProperty(self, "type")
+ prop.title = "Type"
+
stat = CuminStat(self, "producers")
stat.title = "Producers"
stat.unit = "producer"
@@ -677,6 +725,9 @@
super(CuminBinding, self).__init__(model, "binding",
Binding, BindingStats)
+ prop = CuminProperty(self, "bindingKey")
+ prop.title = "Binding Key"
+
stat = CuminStat(self, "msgMatched")
stat.title = "Msgs. Matched"
stat.unit = "message"
@@ -692,6 +743,9 @@
def __init__(self, model):
super(CuminClient, self).__init__(model, "client", Client, ClientStats)
+ prop = CuminProperty(self, "address")
+ prop.title = "Address"
+
stat = CuminStat(self, "closing")
stat.title = "Closing Down"
stat.categories = ("general",)
@@ -736,6 +790,15 @@
super(CuminSession, self).__init__(model, "session",
Session, SessionStats)
+ prop = CuminProperty(self, "name")
+ prop.title = "Name"
+
+ prop = CuminProperty(self, "channelId")
+ prop.title = "Channel ID"
+
+ prop = CuminProperty(self, "detachedLifespan")
+ prop.title = "Detached Lifespan"
+
stat = CuminStat(self, "expireTime")
stat.title = "Expiration"
stat.categories = ("general",)
@@ -789,6 +852,12 @@
def __init__(self, model):
super(CuminLink, self).__init__(model, "link", Link, LinkStats)
+ prop = CuminProperty(self, "address")
+ prop.title = "Peer Address"
+
+ prop = CuminProperty(self, "authIdentity")
+ prop.title = "Auth. Identity"
+
stat = CuminStat(self, "closing")
stat.title = "Closing Down"
stat.categories = ("general",)
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-04-04 13:44:32 UTC (rev 1837)
+++ mgmt/cumin/python/cumin/stat.py 2008-04-04 15:13:52 UTC (rev 1838)
@@ -85,7 +85,7 @@
def render_href(self, session, object):
params = list()
- cls = self.app.model.get_class_by_object(object).name
+ cls = self.app.model.get_class_by_object(object).cumin_name
params.append("class=%s" % cls)
params.append("id=%i" % object.id)
16 years, 2 months
rhmessaging commits: r1837 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-04 09:44:32 -0400 (Fri, 04 Apr 2008)
New Revision: 1837
Modified:
mgmt/cumin/python/cumin/model.py
Log:
Simplify the ui metadata, and correctly specify the category tuple.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-03 21:11:41 UTC (rev 1836)
+++ mgmt/cumin/python/cumin/model.py 2008-04-04 13:44:32 UTC (rev 1837)
@@ -166,11 +166,10 @@
self.status, self.args, self.exception
class CuminStat(object):
- def __init__(self, cls, name, type):
+ def __init__(self, cls, name):
self.model = cls.model
self.cumin_class = cls
self.name = name
- self.type = type
self.unit = None
self.title = None
self.categories = ()
@@ -213,7 +212,7 @@
if value is None:
text = ""
- elif self.type is int:
+ elif type(value) in (int, long):
if value == 0:
text = "0"
else:
@@ -440,176 +439,176 @@
def __init__(self, model):
super(CuminQueue, self).__init__(model, "queue", Queue, QueueStats)
- stat = CuminStat(self, "consumers", int)
+ stat = CuminStat(self, "consumers")
stat.title = "Consumers"
stat.unit = "consumer"
stat.categories = ("general")
stat.highlow = True
- stat = CuminStat(self, "bindings", int)
+ stat = CuminStat(self, "bindings")
stat.title = "Bindings"
stat.unit = "binding"
stat.categories = ("general")
stat.highlow = True
- stat = CuminStat(self, "msgDepth", int)
+ stat = CuminStat(self, "msgDepth")
stat.title = "Message Depth"
stat.unit = "message"
stat.categories = ("message", "general")
stat.highlow = True
- stat = CuminStat(self, "msgTotalEnqueues", int)
+ stat = CuminStat(self, "msgTotalEnqueues")
stat.title = "Msgs. Enqueued"
stat.unit = "message"
stat.categories = ("message", "general")
- stat = CuminStat(self, "msgTotalDequeues", int)
+ stat = CuminStat(self, "msgTotalDequeues")
stat.title = "Msgs. Dequeued"
stat.unit = "message"
stat.categories = ("message", "general")
- stat = CuminStat(self, "byteDepth", int)
+ stat = CuminStat(self, "byteDepth")
stat.title = "Byte Depth"
stat.unit = "byte"
stat.categories = ("byte", "general")
stat.highlow = True
- stat = CuminStat(self, "byteTotalEnqueues", int)
+ stat = CuminStat(self, "byteTotalEnqueues")
stat.title = "Bytes Enqueued"
stat.unit = "byte"
stat.categories = ("byte", "general")
- stat = CuminStat(self, "byteTotalDequeues", int)
+ stat = CuminStat(self, "byteTotalDequeues")
stat.title = "Bytes Dequeued"
stat.unit = "byte"
stat.categories = ("byte", "general")
- stat = CuminStat(self, "unackedMessages", int)
+ stat = CuminStat(self, "unackedMessages")
stat.title = "Msgs. Unacked"
stat.unit = "message"
stat.categories = ("general")
stat.highlow = True
- stat = CuminStat(self, "messageLatencyMin", int)
+ stat = CuminStat(self, "messageLatencyMin")
stat.title = "Min. Msg. Latency"
stat.unit = "nanosecond"
stat.categories = ("general")
- stat = CuminStat(self, "messageLatencyMax", int)
+ stat = CuminStat(self, "messageLatencyMax")
stat.title = "Max. Msg. Latency"
stat.unit = "nanosecond"
stat.categories = ("general")
- stat = CuminStat(self, "messageLatencyAverage", int)
+ stat = CuminStat(self, "messageLatencyAverage")
stat.title = "Avg. Msg. Latency"
stat.unit = "nanosecond"
stat.categories = ("general")
- stat = CuminStat(self, "messageLatencySamples", int)
+ stat = CuminStat(self, "messageLatencySamples")
stat.title = "Msg. Latency Samples"
stat.unit = "sample"
stat.categories = ("general")
# Disk
- #stat = CuminStat(self, "diskPageSize", int)
+ #stat = CuminStat(self, "diskPageSize")
#stat.title = "Page size"
#stat.categories = ("disk")
- #stat = CuminStat(self, "diskPages", int)
+ #stat = CuminStat(self, "diskPages")
#stat.title = "Disk Pages"
#stat.unit = "page"
#stat.categories = ("general")
- #stat = CuminStat(self, "diskAvailableSize", int)
+ #stat = CuminStat(self, "diskAvailableSize")
#stat.title = "Available size"
#stat.categories = ("disk")
# Transactional
- stat = CuminStat(self, "msgTxnEnqueues", int)
+ stat = CuminStat(self, "msgTxnEnqueues")
stat.title = "Msgs. Enqueued"
stat.unit = "message"
- stat.categories = ("message", "transactional")
+ stat.categories = ("transactional",)
- stat = CuminStat(self, "msgTxnDequeues", int)
+ stat = CuminStat(self, "msgTxnDequeues")
stat.title = "Msgs. Dequeued"
stat.unit = "message"
- stat.categories = ("message", "transactional")
+ stat.categories = ("transactional",)
- stat = CuminStat(self, "byteTxnEnqueues", int)
+ stat = CuminStat(self, "byteTxnEnqueues")
stat.title = "Bytes Enqueued"
stat.unit = "byte"
- stat.categories = ("byte", "transactional")
+ stat.categories = ("transactional",)
- stat = CuminStat(self, "byteTxnDequeues", int)
+ stat = CuminStat(self, "byteTxnDequeues")
stat.title = "Bytes Dequeued"
stat.unit = "byte"
- stat.categories = ("byte", "transactional")
+ stat.categories = ("transactional",)
- stat = CuminStat(self, "enqueueTxnStarts", int)
+ stat = CuminStat(self, "enqueueTxnStarts")
stat.title = "Enq. Trans. Started"
stat.unit = "transaction"
- stat.categories = ("transaction")
+ stat.categories = ("transaction",)
- stat = CuminStat(self, "enqueueTxnCommits", int)
+ stat = CuminStat(self, "enqueueTxnCommits")
stat.title = "Enq. Trans. Committed"
stat.unit = "transaction"
- stat.categories = ("transaction")
+ stat.categories = ("transaction",)
- stat = CuminStat(self, "enqueueTxnRejects", int)
+ stat = CuminStat(self, "enqueueTxnRejects")
stat.title = "Enq. Trans. Rejected"
stat.unit = "transaction"
- stat.categories = ("transaction")
+ stat.categories = ("transaction",)
- stat = CuminStat(self, "enqueueTxnCount", int)
+ stat = CuminStat(self, "enqueueTxnCount")
stat.title = "Enq. Trans. Pending"
stat.unit = "transaction"
- stat.categories = ("transaction")
+ stat.categories = ("transaction",)
stat.highlow = True
- stat = CuminStat(self, "dequeueTxnStarts", int)
+ stat = CuminStat(self, "dequeueTxnStarts")
stat.title = "Deq. Trans. Started"
stat.unit = "transaction"
- stat.categories = ("transaction")
+ stat.categories = ("transaction",)
- stat = CuminStat(self, "dequeueTxnCommits", int)
+ stat = CuminStat(self, "dequeueTxnCommits")
stat.title = "Deq. Trans. Committed"
stat.unit = "transaction"
- stat.categories = ("transaction")
+ stat.categories = ("transaction",)
- stat = CuminStat(self, "dequeueTxnRejects", int)
+ stat = CuminStat(self, "dequeueTxnRejects")
stat.title = "Deq. Trans. Rejected"
stat.unit = "transaction"
- stat.categories = ("transaction")
+ stat.categories = ("transaction",)
- stat = CuminStat(self, "dequeueTxnCount", int)
+ stat = CuminStat(self, "dequeueTxnCount")
stat.title = "Deq. Trans. Pending"
stat.unit = "transaction"
- stat.categories = ("transaction")
+ stat.categories = ("transaction",)
stat.highlow = True
# Persistent
- stat = CuminStat(self, "msgPersistEnqueues", int)
+ stat = CuminStat(self, "msgPersistEnqueues")
stat.title = "Msgs. Enqueued"
stat.unit = "message"
- stat.categories = ("message", "persistent")
+ stat.categories = ("persistent",)
- stat = CuminStat(self, "msgPersistDequeues", int)
+ stat = CuminStat(self, "msgPersistDequeues")
stat.title = "Msgs. Dequeued"
stat.unit = "message"
- stat.categories = ("message", "persistent")
+ stat.categories = ("persistent",)
- stat = CuminStat(self, "bytePersistEnqueues", int)
+ stat = CuminStat(self, "bytePersistEnqueues")
stat.title = "Bytes Enqueued"
stat.unit = "byte"
- stat.categories = ("byte", "persistent")
+ stat.categories = ("persistent",)
- stat = CuminStat(self, "bytePersistDequeues", int)
+ stat = CuminStat(self, "bytePersistDequeues")
stat.title = "Bytes Dequeued"
stat.unit = "byte"
- stat.categories = ("byte", "persistent")
+ stat.categories = ("persistent",)
self.Purge(self, "purge")
@@ -628,47 +627,47 @@
super(CuminExchange, self).__init__(model, "exchange",
Exchange, ExchangeStats)
- stat = CuminStat(self, "producers", int)
+ stat = CuminStat(self, "producers")
stat.title = "Producers"
stat.unit = "producer"
- stat.categories = ("general")
+ stat.categories = ("general",)
stat.highlow = True
- stat = CuminStat(self, "bindings", int)
+ stat = CuminStat(self, "bindings")
stat.title = "Bindings"
stat.unit = "binding"
- stat.categories = ("general")
+ stat.categories = ("general",)
stat.highlow = True
- stat = CuminStat(self, "msgReceives", int)
+ stat = CuminStat(self, "msgReceives")
stat.title = "Msgs. Received"
stat.unit = "message"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "msgRoutes", int)
+ stat = CuminStat(self, "msgRoutes")
stat.title = "Msgs. Routed"
stat.unit = "message"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "msgDrops", int)
+ stat = CuminStat(self, "msgDrops")
stat.title = "Msgs. Dropped"
stat.unit = "message"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "byteReceives", int)
+ stat = CuminStat(self, "byteReceives")
stat.title = "Bytes Received"
stat.unit = "message"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "byteRoutes", int)
+ stat = CuminStat(self, "byteRoutes")
stat.title = "Bytes Routed"
stat.unit = "message"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "byteDrops", int)
+ stat = CuminStat(self, "byteDrops")
stat.title = "Bytes Dropped"
stat.unit = "message"
- stat.categories = ("general")
+ stat.categories = ("general",)
def get_title(self, session):
return "Exchange"
@@ -678,10 +677,10 @@
super(CuminBinding, self).__init__(model, "binding",
Binding, BindingStats)
- stat = CuminStat(self, "msgMatched", int)
+ stat = CuminStat(self, "msgMatched")
stat.title = "Msgs. Matched"
stat.unit = "message"
- stat.categories = ("general")
+ stat.categories = ("general",)
def get_title(self, session):
return "Binding"
@@ -693,29 +692,29 @@
def __init__(self, model):
super(CuminClient, self).__init__(model, "client", Client, ClientStats)
- stat = CuminStat(self, "closing", bool)
+ stat = CuminStat(self, "closing")
stat.title = "Closing Down"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "bytesFromClient", int)
+ stat = CuminStat(self, "bytesFromClient")
stat.title = "Bytes Sent"
stat.unit = "byte"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "bytesToClient", int)
+ stat = CuminStat(self, "bytesToClient")
stat.title = "Bytes Received"
stat.unit = "byte"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "framesFromClient", int)
+ stat = CuminStat(self, "framesFromClient")
stat.title = "Frames Sent"
stat.unit = "frame"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "framesToClient", int)
+ stat = CuminStat(self, "framesToClient")
stat.title = "Frames Received"
stat.unit = "frame"
- stat.categories = ("general")
+ stat.categories = ("general",)
self.Close(self, "close")
@@ -737,18 +736,18 @@
super(CuminSession, self).__init__(model, "session",
Session, SessionStats)
- stat = CuminStat(self, "expireTime", datetime)
+ stat = CuminStat(self, "expireTime")
stat.title = "Expiration"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "framesOutstanding", int)
+ stat = CuminStat(self, "framesOutstanding")
stat.title = "Frames Outstanding"
stat.unit = "frame"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "attached", bool)
+ stat = CuminStat(self, "attached")
stat.title = "Attached"
- stat.categories = ("general")
+ stat.categories = ("general",)
self.Close(self, "close")
self.Detach(self, "detach")
@@ -790,29 +789,29 @@
def __init__(self, model):
super(CuminLink, self).__init__(model, "link", Link, LinkStats)
- stat = CuminStat(self, "closing", bool)
+ stat = CuminStat(self, "closing")
stat.title = "Closing Down"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "framesFromPeer", int)
+ stat = CuminStat(self, "framesFromPeer")
stat.title = "Frames from Peer"
stat.unit = "frame"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "framesToPeer", int)
+ stat = CuminStat(self, "framesToPeer")
stat.title = "Frames to Peer"
stat.unit = "frame"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "bytesFromPeer", int)
+ stat = CuminStat(self, "bytesFromPeer")
stat.title = "Bytes from Peer"
stat.unit = "byte"
- stat.categories = ("general")
+ stat.categories = ("general",)
- stat = CuminStat(self, "bytesToPeer", int)
+ stat = CuminStat(self, "bytesToPeer")
stat.title = "Bytes to Peer"
stat.unit = "byte"
- stat.categories = ("general")
+ stat.categories = ("general",)
def get_title(self, session):
return "Broker Link"
16 years, 2 months
rhmessaging commits: r1836 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-03 17:11:41 -0400 (Thu, 03 Apr 2008)
New Revision: 1836
Modified:
mgmt/cumin/python/cumin/model.py
Log:
Make xml method args consistent
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-03 20:19:20 UTC (rev 1835)
+++ mgmt/cumin/python/cumin/model.py 2008-04-03 21:11:41 UTC (rev 1836)
@@ -312,10 +312,10 @@
def get_object_name(self, object):
return object.name
- def write_event_xml(self, object, writer):
+ def write_event_xml(self, writer, object):
writer.write("<events errors=\"%i\" warnings=\"%i\"/>" % (0, 0))
- def write_stat_xml(self, object, writer):
+ def write_stat_xml(self, writer, object):
for stat in self.stats:
stat.write_xml(writer, object)
@@ -323,8 +323,8 @@
writer.write("<%s id=\"%i\" name=\"%s\">" % \
(self.name, object.id, self.get_object_name(object)))
- self.write_event_xml(object, writer)
- self.write_stat_xml(object, writer)
+ self.write_event_xml(writer, object)
+ self.write_stat_xml(writer, object)
writer.write("</%s>" % self.name)
16 years, 2 months
rhmessaging commits: r1835 - in mgmt: cumin/python/wooly and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-03 16:19:20 -0400 (Thu, 03 Apr 2008)
New Revision: 1835
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/queue.py
mgmt/cumin/python/cumin/stat.py
mgmt/cumin/python/cumin/system.py
mgmt/cumin/python/cumin/widgets.py
mgmt/cumin/python/wooly/__init__.py
mgmt/cumin/python/wooly/forms.py
mgmt/notes/justin-todo.txt
Log:
XXX cleanup
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/broker.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -33,11 +33,6 @@
self.groups = self.BrokerSetGroupInput(app, "groups", self)
self.add_child(self.groups)
- # XXX get rid of this
- self.submit = BooleanParameter(app, "submit")
- self.add_parameter(self.submit)
- self.add_form_parameter(self.submit)
-
self.__unregister = self.Unregister(app, "unregister", self)
self.add_child(self.__unregister)
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/client.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -23,9 +23,6 @@
self.set_default_column(col)
- #col = self.SessionsColumn(app, "sess")
- #self.add_column(col)
-
col = self.SentColumn(app, "sent")
col.alignment = "right"
self.add_column(col)
@@ -86,19 +83,6 @@
self.frame.show_client(branch, client).show_view(branch)
return fmt_olink(branch, client, name=data["addr"])
- class SessionsColumn(SqlTableColumn):
- def render_title(self, session, data):
- return "Sessions"
-
- def render_content(self, session, data):
- client = Identifiable(data["id"])
- branch = session.branch()
- frame = self.frame.show_client(branch, client)
- frame.show_view(branch).show_sessions(branch)
- # XXX client.sessions won't work
- #return fmt_link(branch.marshal(), client.sessions.count())
- return "XXX"
-
class SentColumn(NullSortColumn, FreshDataOnlyColumn):
def render_title(self, session, data):
return "%s Sent" % self.parent.get_unit_plural(session)
@@ -205,20 +189,16 @@
class ClientStatus(CuminStatus):
def render_frames_from(self, session, client):
- stat = self.app.model.client.get_stat("framesFromClient")
- return fmt_rate(stat.rate(client), "frame", "sec")
+ return self.app.model.client.framesFromClient.rate_html(client)
def render_frames_to(self, session, client):
- stat = self.app.model.client.get_stat("framesToClient")
- return fmt_rate(stat.rate(client), "frame", "sec")
+ return self.app.model.client.framesToClient.rate_html(client)
def render_bytes_from(self, session, client):
- stat = self.app.model.client.get_stat("bytesFromClient")
- return fmt_rate(stat.rate(client), "byte", "sec")
+ return self.app.model.client.bytesFromClient.rate_html(client)
def render_bytes_to(self, session, client):
- stat = self.app.model.client.get_stat("bytesToClient")
- return fmt_rate(stat.rate(client), "byte", "sec")
+ return self.app.model.client.bytesToClient.rate_html(client)
class ClientView(CuminView):
def __init__(self, app, name):
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/exchange.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -172,22 +172,22 @@
class ExchangeStatus(CuminStatus):
def render_messages_received(self, session, exchange):
- return self.app.model.exchange.get_stat("msgReceives").rate_html(exchange)
+ return self.app.model.exchange.msgReceives.rate_html(exchange)
def render_messages_routed(self, session, exchange):
- return self.app.model.exchange.get_stat("msgRoutes").rate_html(exchange)
+ return self.app.model.exchange.msgRoutes.rate_html(exchange)
def render_messages_dropped(self, session, exchange):
- return self.app.model.exchange.get_stat("msgDrops").value(exchange)
+ return self.app.model.exchange.msgDrops.value(exchange)
def render_bytes_received(self, session, exchange):
- return self.app.model.exchange.get_stat("byteReceives").rate_html(exchange)
+ return self.app.model.exchange.byteReceives.rate_html(exchange)
def render_bytes_routed(self, session, exchange):
- return self.app.model.exchange.get_stat("byteRoutes").rate_html(exchange)
+ return self.app.model.exchange.byteRoutes.rate_html(exchange)
def render_bytes_dropped(self, session, exchange):
- return self.app.model.exchange.get_stat("byteDrops").value(exchange)
+ return self.app.model.exchange.byteDrops.value(exchange)
class ExchangeView(CuminView):
def __init__(self, app, name):
@@ -445,17 +445,3 @@
def render_item_name(self, session, producer):
return producer.name
-
- def render_item_messages_produced(self, session, producer):
- return producer.statsCurr.msgsProduced #XXX statify
-
- def render_item_messages_produced_rate(self, session, producer):
- value = producer.statsCurr.msgsProduced #XXX statify
- return fmt_rate(value, "msg", "sec")
-
- def render_item_bytes_produced(self, session, producer):
- return producer.statsCurr.bytesProduced #XXX statify
-
- def render_item_bytes_produced_rate(self, session, producer):
- value = producer.statsCurr.bytesProduced #XXX statify
- return fmt_rate(value, "byte", "sec")
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/model.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -45,12 +45,6 @@
if cls.mint_class is mint_object.__class__:
return cls
- # XXX get rid of this
- def get_class_by_name(self, name):
- for cls in self.classes:
- if cls.name == name:
- return cls
-
def count_invocations(self, status):
count = 0
@@ -73,8 +67,7 @@
for object in objects:
cls = self.get_class_by_object(object)
- # XXX swap the args
- cls.write_xml(object, writer)
+ cls.write_xml(writer, object)
writer.write("</model>")
@@ -277,7 +270,7 @@
except AttributeError:
pass
- def write_xml(self, object, writer):
+ def write_xml(self, writer, object):
value = self.value_text(object)
rate = self.rate_text(object)
@@ -304,12 +297,6 @@
self.stats.append(stat)
setattr(self, stat.name, stat)
- # XXX get rid of this
- def get_stat(self, name):
- for stat in self.stats:
- if stat.name == name:
- return stat
-
def add_action(self, action):
self.actions.append(action)
setattr(self, action.name, action)
@@ -330,9 +317,9 @@
def write_stat_xml(self, object, writer):
for stat in self.stats:
- stat.write_xml(object, writer)
+ stat.write_xml(writer, object)
- def write_xml(self, object, writer):
+ def write_xml(self, writer, object):
writer.write("<%s id=\"%i\" name=\"%s\">" % \
(self.name, object.id, self.get_object_name(object)))
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/page.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -67,10 +67,6 @@
self.__tabs = MainFrameTabs(app, "tabs")
self.add_child(self.__tabs)
- # XXX get rid of this
- self.__object = Attribute(app, "object")
- self.add_attribute(self.__object)
-
self.__view = MainView(app, "view")
self.add_mode(self.__view)
self.set_view_mode(self.__view)
@@ -108,7 +104,6 @@
return branch.marshal()
def render_frames(self, session):
- self.__object.set(session, object)
writer = Writer()
for frame in self.page.get_frames(session):
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/queue.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -195,37 +195,31 @@
class QueueStatus(CuminStatus):
def render_consumers(self, session, queue):
- return self.app.model.queue.get_stat("consumers").value(queue)
+ return self.app.model.queue.consumers.value(queue)
def render_messages_enqueued(self, session, queue):
- stat = self.app.model.queue.get_stat("msgTotalEnqueues")
- return fmt_rate(stat.rate(queue), "msg", "sec")
+ return self.app.model.queue.msgTotalEnqueues.rate_html(queue)
def render_messages_dequeued(self, session, queue):
- stat = self.app.model.queue.get_stat("msgTotalDequeues")
- return fmt_rate(stat.rate(queue), "msg", "sec")
+ return self.app.model.queue.msgTotalDequeues.rate_html(queue)
def render_message_depth(self, session, queue):
- return self.app.model.queue.get_stat("msgDepth").value(queue)
+ return self.app.model.queue.msgDepth.value(queue)
def render_message_depth_accel(self, session, queue):
- stat = self.app.model.queue.get_stat("msgDepth")
- return fmt_rate(stat.rate(queue), "msg", "sec")
+ return self.app.model.queue.msgDepth.rate_html(queue)
def render_bytes_enqueued(self, session, queue):
- stat = self.app.model.queue.get_stat("byteTotalEnqueues")
- return fmt_rate(stat.rate(queue), "byte", "sec")
+ return self.app.model.queue.byteTotalEnqueues.rate_html(queue)
def render_bytes_dequeued(self, session, queue):
- stat = self.app.model.queue.get_stat("byteTotalDequeues")
- return fmt_rate(stat.rate(queue), "byte", "sec")
+ return self.app.model.queue.byteTotalDequeues.rate_html(queue)
def render_byte_depth(self, session, queue):
- return self.app.model.queue.get_stat("byteDepth").value(queue)
+ return self.app.model.queue.byteDepth.value(queue)
def render_byte_depth_accel(self, session, queue):
- stat = self.app.model.queue.get_stat("byteDepth")
- return fmt_rate(stat.rate(queue), "byte", "sec")
+ return self.app.model.queue.byteDepth.rate_html(queue)
class QueueView(CuminView):
def __init__(self, app, name):
@@ -419,14 +413,8 @@
def process_submit(self, session, queue):
if self.validate(session):
- binding = Binding()
+ raise Exception("Not implemented")
- binding.binding_key = self.binding_key.get(session)
-
- # XXX uh huh
- binding.set_queue(queue)
- binding.set_exchange(self.exchanges.get(session))
-
self.process_cancel(session, queue)
def render_title(self, session, queue):
@@ -520,21 +508,16 @@
return consumer.name
def render_item_messages_consumed(self, session, consumer):
- stat = self.app.model.consumer.get_stat("msgsConsumed")
- return stat.value(consumer)
+ return self.app.model.consumer.msgsConsumed.value(consumer)
def render_item_messages_consumed_rate(self, session, consumer):
- stat = self.app.model.consumer.get_stat("msgsConsumed")
- return fmt_rate(stat.rate(consumer), "msg", "sec")
+ return self.app.model.consumer.msgsConsumed.rate_html(consumer)
def render_item_bytes_consumed(self, session, consumer):
- stat = self.app.model.consumer.get_stat("bytesConsumed")
- return stat.value(consumer)
+ return self.app.model.consumer.bytesConsumed.value(consumer)
def render_item_bytes_consumed_rate(self, session, consumer):
- stat = self.app.model.consumer.get_stat("bytesConsumed")
- return fmt_rate(stat.rate(consumer), "byte", "sec")
+ return self.app.model.consumer.bytesConsumed.rate_html(consumer)
def render_item_unacked_messages(self, session, consumer):
- stat = self.app.model.consumer.get_stat("unackedMessages")
- return stat.value(consumer)
+ return self.app.model.consumer.unackedMessages.value(consumer)
Modified: mgmt/cumin/python/cumin/stat.py
===================================================================
--- mgmt/cumin/python/cumin/stat.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/stat.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -66,10 +66,6 @@
return stat.rate_html(object)
- def render_item_average(self, session, args):
- stat, object = args
- return None #XXX "%0.2f" % (sum(stat.values) / float(len(stat.values)))
-
class StatValueChart(Widget):
def __init__(self, app, name):
super(StatValueChart, self).__init__(app, name)
@@ -114,7 +110,7 @@
for name in self.stats:
cls = self.app.model.get_class_by_object(object)
- stat = cls.get_stat(name)
+ stat = getattr(cls, name)
self.stats_tmpl.render(writer, session, stat, object)
return writer.to_string()
@@ -175,7 +171,7 @@
chart = LineChart(480, 120)
cls = self.class_.get(session)
- stats = [cls.get_stat(x) for x in self.stats.get(session)]
+ stats = [getattr(cls, x) for x in self.stats.get(session)]
samples = dict()
values = dict()
Modified: mgmt/cumin/python/cumin/system.py
===================================================================
--- mgmt/cumin/python/cumin/system.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/system.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -20,11 +20,6 @@
col = self.NameColumn(app, "name")
self.add_column(col)
- # XXX get rid of this
- self.submit = BooleanParameter(app, "submit")
- self.add_parameter(self.submit)
- self.add_form_parameter(self.submit)
-
def render_title(self, session, *args):
count = System.select().count()
return "Systems %s" % fmt_count(count)
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/cumin/widgets.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -463,12 +463,10 @@
return binding.bindingKey
def render_item_messages_matched(self, session, binding):
- stat = self.app.model.binding.get_stat("msgMatched")
- return stat.value(binding)
+ return self.app.model.binding.msgMatched.value(binding)
def render_item_messages_matched_rate(self, session, binding):
- stat = self.app.model.binding.get_stat("msgMatched")
- return fmt_rate(stat.rate(binding), "msg", "sec")
+ return self.app.model.binding.msgMatched.rate_html(binding)
class CheckboxIdColumn(SqlTableColumn):
def __init__(self, app, name, form):
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/wooly/__init__.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -494,7 +494,8 @@
def set_page(self, page):
self.page = page
- def get(self, key): # XXX we can make this a little faster, no?
+ # This is the biggest hotspot in cumin-bench profiling
+ def get(self, key):
if key in self.values:
value = self.values[key]
elif self.trunk:
@@ -535,41 +536,39 @@
def marshal_url_vars(self, separator=";"):
params = self.get_page().get_saved_parameters(self)
+ vars = list()
- if params: # XXX removing this may make sense; it's an uncommon case
- vars = list()
+ for param in params:
+ key = param.path
- for param in params:
- key = param.path
+ if param.is_collection:
+ collection = self.get(key)
- if param.is_collection:
- collection = self.get(key)
+ if collection:
+ for value in collection:
+ svalue = quote(param.marshal(value))
+ vars.append("%s=%s" % (key, svalue))
+ else:
+ #value = self.get(key)
- if collection:
- for value in collection:
- svalue = quote(param.marshal(value))
- vars.append("%s=%s" % (key, svalue))
+ # Inlined below saving about a second in a
+ # 1000-hit profile
+
+ if key in self.values:
+ value = self.values[key]
+ elif self.trunk:
+ value = self.trunk.get(key)
else:
- #value = self.get(key)
+ value = None
- # Inlined below saving about a second in a
- # 1000-hit profile
-
- if key in self.values:
- value = self.values[key]
- elif self.trunk:
- value = self.trunk.get(key)
- else:
- value = None
+ default = param.get_default(self)
- default = param.get_default(self)
+ if value not in (default, None):
+ svalue = quote(param.marshal(value))
+ vars.append("%s=%s" % (key, svalue))
- if value not in (default, None):
- svalue = quote(param.marshal(value))
- vars.append("%s=%s" % (key, svalue))
+ return separator.join(vars)
- return separator.join(vars)
-
def unmarshal(self, string):
elems = string.split("?")
Modified: mgmt/cumin/python/wooly/forms.py
===================================================================
--- mgmt/cumin/python/wooly/forms.py 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/cumin/python/wooly/forms.py 2008-04-03 20:19:20 UTC (rev 1835)
@@ -153,20 +153,13 @@
self.value = None
- def xxx_set_value(self, value):
- self.value = value
-
- # XXX get rid of this
- def get_value(self, session, *args):
- pass
-
def render_value(self, session, *args):
- return self.get_value(session, *args)
+ return self.value
def render_checked_attr(self, session, *args):
value = self.get(session)
- if value and value == self.get_value(session, *args):
+ if value and value == self.value:
return "checked=\"checked\""
class FormButton(FormInput):
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2008-04-03 12:43:05 UTC (rev 1834)
+++ mgmt/notes/justin-todo.txt 2008-04-03 20:19:20 UTC (rev 1835)
@@ -18,6 +18,8 @@
Deferred
+ * Change the way CuminAction.invoke works
+
* Resolve design questions around view navigation
* Blow up if we try to call set_redirect_url twice in a session
16 years, 2 months
rhmessaging commits: r1834 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-03 08:43:05 -0400 (Thu, 03 Apr 2008)
New Revision: 1834
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
Log:
Updated to class JournalImpl to support Ted Ross' patch in qpid (svn r644287).
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-04-02 20:23:05 UTC (rev 1833)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-04-03 12:43:05 UTC (rev 1834)
@@ -392,6 +392,12 @@
}
}
+qpid::management::Manageable::status_t JournalImpl::ManagementMethod (uint32_t /*methodId*/,
+ qpid::management::Args& /*args*/)
+{
+ return Manageable::STATUS_UNKNOWN_METHOD;
+}
+
// void
// JournalImpl::aio_rd_callback(jcntl* /*journal*/, std::vector<u_int16_t>& /*pil*/)
// {}
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-04-02 20:23:05 UTC (rev 1833)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-04-03 12:43:05 UTC (rev 1834)
@@ -33,7 +33,6 @@
#include <qpid/sys/Time.h>
#include <boost/ptr_container/ptr_list.hpp>
#include <boost/intrusive_ptr.hpp>
-#include <boost/shared_ptr.hpp>
namespace rhm {
namespace bdbstore {
@@ -154,6 +153,12 @@
void getEventsFire();
void flushFire();
+ qpid::management::ManagementObject::shared_ptr GetManagementObject (void) const
+ { qpid::management::ManagementObject::shared_ptr p; return p; }
+
+ qpid::management::Manageable::status_t ManagementMethod (uint32_t,
+ qpid::management::Args&);
+
private:
inline void setGetEventTimer()
{
16 years, 2 months
rhmessaging commits: r1833 - in store/trunk/cpp: lib/jrnl and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-02 16:23:05 -0400 (Wed, 02 Apr 2008)
New Revision: 1833
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/rcvdat.hpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
store/trunk/cpp/lib/jrnl/wmgr.hpp
store/trunk/cpp/tests/jrnl/_st_basic.cpp
store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/_st_read.cpp
store/trunk/cpp/tests/jrnl/_st_read_txn.cpp
store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp
Log:
Moved journal file geometry parameters (num files & file size) from constructor to initialize() and recover() methods. This is logically where they belong; also it enables the management instrumentation to change these parameters through a stop() and initialize() sequence.
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -251,12 +251,12 @@
JournalImpl* jQueue = 0;
{
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue), string("JournalData"), numJrnlFiles, jrnlFsizePgs * JRNL_RMGR_PAGE_SIZE, defJournalGetEventsTimeout, defJournalFlushTimeout);
+ jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue), string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout);
}
queue.setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
try {
// init will create the deque's for the init...
- jQueue->initialize();
+ jQueue->initialize(numJrnlFiles, jrnlFsizePgs * JRNL_RMGR_PAGE_SIZE);
} catch (const journal::jexception& e) {
THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ": create() failed: " + e.what());
}
@@ -423,14 +423,14 @@
JournalImpl* jQueue = 0;
{
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queueName, getJrnlDir(queueName), string("JournalData"), numJrnlFiles, jrnlFsizePgs * JRNL_RMGR_PAGE_SIZE, defJournalGetEventsTimeout, defJournalFlushTimeout);
+ jQueue = new JournalImpl(queueName, getJrnlDir(queueName), string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout);
}
queue->setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
try
{
u_int64_t thisHighestRid = 0;
- jQueue->recover(prepared, thisHighestRid, key.id); // start recovery
+ jQueue->recover(numJrnlFiles, jrnlFsizePgs * JRNL_RMGR_PAGE_SIZE, prepared, thisHighestRid, key.id); // start recovery
if (thisHighestRid > highestRid)
highestRid = thisHighestRid;
recoverMessages(txn, registry, queue, prepared, messages);
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -45,11 +45,9 @@
JournalImpl::JournalImpl(const std::string& journalId,
const std::string& journalDirectory,
const std::string& journalBaseFilename,
- const u_int16_t num_jfiles,
- const u_int32_t jfsize_sblks,
const qpid::sys::Duration getEventsTimeout,
const qpid::sys::Duration flushTimeout):
- jcntl(journalId, journalDirectory, journalBaseFilename, num_jfiles, jfsize_sblks),
+ jcntl(journalId, journalDirectory, journalBaseFilename),
getEventsTimerSetFlag(false),
writeActivityFlag(false),
flushTriggeredFlag(true),
@@ -70,23 +68,13 @@
journalTimerPtr->add(inactivityFireEventPtr);
log(LOG_NOTICE, "Instantiation");
- std::ostringstream oss1;
- oss1 << "Journal directory = \"" << journalDirectory << "\"";
- log(LOG_INFO, oss1.str());
- std::ostringstream oss2;
- oss2 << "Base file name = \"" << journalBaseFilename << "\"";
- log(LOG_DEBUG, oss2.str());
- std::ostringstream oss3;
- oss3 << "Number of journal files = " << num_jfiles;
- log(LOG_DEBUG, oss3.str());
- std::ostringstream oss4;
- oss4 << "Journal file size (sblks) = " << jfsize_sblks;
- log(LOG_DEBUG, oss4.str());
+ std::ostringstream oss;
+ oss << "Journal directory = \"" << journalDirectory << "\"; Base file name = \"" << journalBaseFilename << "\"";
+ log(LOG_DEBUG, oss.str());
}
JournalImpl::~JournalImpl()
{
- log(LOG_DEBUG, "Destroyed");
if (_init_flag && !_stop_flag){
try { stop(true); }
catch (const jexception& e) { std::cerr << e << std::endl; }
@@ -100,29 +88,37 @@
::free(_datap);
_datap = 0;
}
+
+ // TODO: Make this if() thread-safe
if (journalTimerPtr && --cnt == 0)
{
delete journalTimerPtr;
journalTimerPtr = 0;
}
+
::pthread_mutex_destroy(&_getf_mutex);
+ log(LOG_DEBUG, "Destroyed");
}
void
-JournalImpl::initialize(const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb)
+JournalImpl::initialize(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb)
{
- log(LOG_DEBUG, "Initialize");
- jcntl::initialize(rd_cb, wr_cb);
+ std::ostringstream oss;
+ oss << "Initialize; num_jfiles=" << num_jfiles << " jfsize_sblks=" << jfsize_sblks;
+ log(LOG_DEBUG, oss.str());
+ jcntl::initialize(num_jfiles, jfsize_sblks, rd_cb, wr_cb);
log(LOG_DEBUG, "Initialization complete");
}
void
-JournalImpl::recover(const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb,
+JournalImpl::recover(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb,
boost::ptr_list<bdbstore::PreparedTransaction>& prep_tx_list, u_int64_t& highest_rid,
u_int64_t queue_id)
{
std::ostringstream oss1;
- oss1 << "Recover, queue_id = 0x" << std::hex << queue_id;
+ oss1 << "Recover; num_jfiles=" << num_jfiles << " jfsize_sblks=" << jfsize_sblks << " queue_id = 0x" << std::hex << queue_id;
log(LOG_DEBUG, oss1.str());
// Create list of prepared xids
std::vector<std::string> prep_xid_list;
@@ -131,7 +127,7 @@
prep_xid_list.push_back(i->xid);
}
- jcntl::recover(rd_cb, wr_cb, prep_xid_list, highest_rid);
+ jcntl::recover(num_jfiles, jfsize_sblks, rd_cb, wr_cb, prep_xid_list, highest_rid);
// Populate PreparedTransaction lists from _tmap
for (bdbstore::PreparedTransaction::list::iterator i = prep_tx_list.begin();
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-04-02 20:23:05 UTC (rev 1833)
@@ -89,22 +89,27 @@
JournalImpl(const std::string& journalId,
const std::string& journalDirectory,
const std::string& journalBaseFilename,
- const u_int16_t num_jfiles,
- const u_int32_t jfsize_sblks,
const qpid::sys::Duration getEventsTimeout,
const qpid::sys::Duration flushTimeout);
virtual ~JournalImpl();
- inline void initialize() { jcntl::initialize(0, &aio_wr_callback); }
+ void initialize(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb);
- void initialize(const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb);
- void recover(const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb,
+ inline void initialize(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks) {
+ jcntl::initialize(num_jfiles, jfsize_sblks, 0, &aio_wr_callback);
+ }
+
+ void recover(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb,
boost::ptr_list<bdbstore::PreparedTransaction>& prep_tx_list,
u_int64_t& highest_rid, u_int64_t queue_id);
- inline void recover(boost::ptr_list<bdbstore::PreparedTransaction>& prep_tx_list,
+ inline void recover(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ boost::ptr_list<bdbstore::PreparedTransaction>& prep_tx_list,
u_int64_t& highest_rid, u_int64_t queue_id) {
- recover(0, &aio_wr_callback, prep_tx_list, highest_rid, queue_id);
+ recover(num_jfiles, jfsize_sblks, 0, &aio_wr_callback, prep_tx_list, highest_rid,
+ queue_id);
}
// Temporary fn to read and save last msg read from journal so it can be assigned
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -51,8 +51,7 @@
// Functions
-jcntl::jcntl(const std::string& jid, const std::string& jdir, const std::string& base_filename,
- const u_int16_t num_jfiles, const u_int32_t jfsize_sblks):
+jcntl::jcntl(const std::string& jid, const std::string& jdir, const std::string& base_filename):
_jid(jid),
_jdir(jdir, base_filename),
_base_filename(base_filename),
@@ -60,8 +59,8 @@
_stop_flag(false),
_readonly_flag(false),
_autostop(true),
- _num_jfiles(num_jfiles > JRNL_MIN_NUM_FILES ? num_jfiles : JRNL_MIN_NUM_FILES),
- _jfsize_sblks(jfsize_sblks > JRNL_MIN_FILE_SIZE ? jfsize_sblks :JRNL_MIN_FILE_SIZE),
+ _num_jfiles(0),
+ _jfsize_sblks(0),
_datafh(0),
_emap(),
_tmap(),
@@ -69,7 +68,7 @@
_wrfc(),
_rmgr(this, _emap, _tmap, _rrfc),
_wmgr(this, _emap, _tmap, _wrfc),
- _rcvdat(_num_jfiles)
+ _rcvdat()
{
::pthread_mutex_init(&_wr_mutex, 0);
::pthread_mutex_init(&_gev_mutex, 0);
@@ -91,15 +90,14 @@
}
void
-jcntl::initialize(const rd_aio_cb rd_cb, const wr_aio_cb wr_cb)
+jcntl::initialize(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks, const rd_aio_cb rd_cb, const wr_aio_cb wr_cb)
{
_init_flag = false;
_stop_flag = false;
_readonly_flag = false;
- // Prepare journal dir, journal files and file handles
- _jdir.clear_dir();
_emap.clear();
+ _tmap.clear();
// TODO - place this in a finalize() fn? - see ~jcntl() & recover()...
if (_datafh)
@@ -109,6 +107,18 @@
delete[] _datafh;
}
+ // Set new file geometry parameters
+ assert(num_jfiles >= JRNL_MIN_NUM_FILES);
+ assert(num_jfiles <= JRNL_MAX_NUM_FILES);
+ _num_jfiles = num_jfiles;
+
+ assert(jfsize_sblks >= JRNL_MIN_FILE_SIZE);
+ assert(jfsize_sblks <= JRNL_MAX_FILE_SIZE);
+ _jfsize_sblks = jfsize_sblks;
+
+ // Clear any existing journal files
+ _jdir.clear_dir();
+
_datafh = new lfh*[_num_jfiles];
// Zero the pointer array first because new() can throw exceptions
::memset(_datafh, 0, sizeof(lfh*) * _num_jfiles);
@@ -135,26 +145,16 @@
}
void
-jcntl::recover(const rd_aio_cb rd_cb, const wr_aio_cb wr_cb,
+jcntl::recover(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks, const rd_aio_cb rd_cb, const wr_aio_cb wr_cb,
const std::vector<std::string>& prep_txn_list, u_int64_t& highest_rid)
{
_init_flag = false;
_stop_flag = false;
_readonly_flag = false;
- // Verify journal dir and journal files
- _jdir.verify_dir();
- _rcvdat.reset();
_emap.clear();
_tmap.clear();
- rcvr_janalyze(_rcvdat, prep_txn_list);
- highest_rid = _rcvdat._h_rid;
- if (_rcvdat._full)
- throw jexception(jerrno::JERR_JCNTL_RECOVERJFULL, "jcntl", "recover");
-
- this->log(LOG_DEBUG, _rcvdat.to_string(_jid));
-
// TODO - place this in a finalize() fn? - see ~jcntl() & initialize()...
if (_datafh)
{
@@ -163,6 +163,26 @@
delete[] _datafh;
}
+ // Set new file geometry parameters
+ assert(num_jfiles >= JRNL_MIN_NUM_FILES);
+ assert(num_jfiles <= JRNL_MAX_NUM_FILES);
+ _num_jfiles = num_jfiles;
+
+ assert(jfsize_sblks >= JRNL_MIN_FILE_SIZE);
+ assert(jfsize_sblks <= JRNL_MAX_FILE_SIZE);
+ _jfsize_sblks = jfsize_sblks;
+
+ // Verify journal dir and journal files
+ _jdir.verify_dir();
+ _rcvdat.reset(_num_jfiles);
+
+ rcvr_janalyze(_rcvdat, prep_txn_list);
+ highest_rid = _rcvdat._h_rid;
+ if (_rcvdat._full)
+ throw jexception(jerrno::JERR_JCNTL_RECOVERJFULL, "jcntl", "recover");
+
+ this->log(LOG_DEBUG, _rcvdat.to_string(_jid));
+
_datafh = new lfh*[_num_jfiles];
// 0 the pointer array first because new() can throw exceptions
::memset(_datafh, 0, sizeof(lfh*) * _num_jfiles);
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -141,27 +141,24 @@
pthread_mutex_t _gev_mutex; ///< Mutex for get_events
public:
- /**
- * \brief Journal constructor.
- *
- * Constructor which sets the physical file location and base name.
- *
- * \param jid A unique identifier for this journal instance.
- * \param jdir The directory which will contain the journal files.
- * \param base_filename The string which will be used to start all journal filenames.
- * \param num_jfiles The number of journal files to be created.
- * \param jfsize_sblks The size of each journal file expressed in softblocks.
- */
- jcntl(const std::string& jid, const std::string& jdir, const std::string& base_filename,
- const u_int16_t num_jfiles, const u_int32_t jfsize_sblks);
+ /**
+ * \brief Journal constructor.
+ *
+ * Constructor which sets the physical file location and base name.
+ *
+ * \param jid A unique identifier for this journal instance.
+ * \param jdir The directory which will contain the journal files.
+ * \param base_filename The string which will be used to start all journal filenames.
+ */
+ jcntl(const std::string& jid, const std::string& jdir, const std::string& base_filename);
/**
* \brief Destructor.
*/
- virtual ~jcntl();
+ virtual ~jcntl();
- inline const std::string& id() const { return _jid; }
- inline const std::string& jrnl_dir() const { return _jdir.dirname(); }
+ inline const std::string& id() const { return _jid; }
+ inline const std::string& jrnl_dir() const { return _jdir.dirname(); }
/**
* \brief Initialize the journal for storing data.
@@ -178,12 +175,15 @@
* <b>NOTE: If <i>NULL</i> is passed to the callbacks, internal default callbacks will be
* used.</b>
*
+ * \param num_jfiles The number of journal files to be created.
+ * \param jfsize_sblks The size of each journal file expressed in softblocks.
* \param rd_cb Function pointer to callback function for read operations. May be 0 (NULL).
* \param wr_cb Function pointer to callback function for write operations. May be 0 (NULL).
*
* \exception TODO
*/
- void initialize(const rd_aio_cb rd_cb, const wr_aio_cb wr_cb);
+ void initialize(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ const rd_aio_cb rd_cb, const wr_aio_cb wr_cb);
/**
* /brief Initialize journal by recovering state from previously written journal.
@@ -200,6 +200,8 @@
* <b>NOTE: If <i>NULL</i> is passed to the callbacks, internal default callbacks will be
* used.</b>
*
+ * \param num_jfiles The number of journal files to be created.
+ * \param jfsize_sblks The size of each journal file expressed in softblocks.
* \param rd_cb Function pointer to callback function for read operations. May be 0 (NULL).
* \param wr_cb Function pointer to callback function for write operations. May be 0 (NULL).
* \param prep_txn_list
@@ -207,7 +209,8 @@
*
* \exception TODO
*/
- void recover(const rd_aio_cb rd_cb, const wr_aio_cb wr_cb,
+ void recover(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ const rd_aio_cb rd_cb, const wr_aio_cb wr_cb,
const std::vector<std::string>& prep_txn_list, u_int64_t& highest_rid);
/**
Modified: store/trunk/cpp/lib/jrnl/rcvdat.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rcvdat.hpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/lib/jrnl/rcvdat.hpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -56,7 +56,7 @@
bool _full; ///< Journal is full
std::vector<u_int32_t> _enq_cnt_list; ///< Number enqueued records found for each file
- rcvdat(u_int16_t num_jfiles):
+ rcvdat():
_owi(false),
_frot(false),
_empty(true),
@@ -66,10 +66,10 @@
_eo(0),
_h_rid(0),
_full(false),
- _enq_cnt_list(num_jfiles, 0)
+ _enq_cnt_list()
{}
- void reset()
+ void reset(u_int16_t num_jfiles)
{
_owi=false;
_frot = false;
@@ -80,8 +80,8 @@
_eo=0;
_h_rid=0;
_full = false;
- for (unsigned f=0; f<_enq_cnt_list.size(); f++)
- _enq_cnt_list[f] = 0;
+ _enq_cnt_list.clear();
+ _enq_cnt_list.resize(num_jfiles, 0);
}
std::string to_string(std::string& jid)
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -51,16 +51,14 @@
_fhdr_ptr_arr(0),
_iocba(0),
_cached_offset_dblks(0),
- _jfsize_dblks(_jc->jfsize_sblks() * JRNL_SBLK_SIZE),
- _jfsize_pgs(_jc->jfsize_sblks() / JRNL_WMGR_PAGE_SIZE),
+ _jfsize_dblks(0),
+ _jfsize_pgs(0),
_enq_busy(false),
_deq_busy(false),
_abort_busy(false),
_commit_busy(false),
_txn_pending_set()
-{
- assert(_jc->jfsize_sblks() % JRNL_RMGR_PAGE_SIZE == 0);
-}
+{}
wmgr::wmgr(jcntl* jc, enq_map& emap, txn_map& tmap, wrfc& wrfc,
const u_int32_t max_dtokpp, const u_int32_t max_iowait_us):
@@ -72,16 +70,14 @@
_fhdr_ptr_arr(0),
_iocba(0),
_cached_offset_dblks(0),
- _jfsize_dblks(_jc->jfsize_sblks() * JRNL_SBLK_SIZE),
- _jfsize_pgs(_jc->jfsize_sblks() / JRNL_WMGR_PAGE_SIZE),
+ _jfsize_dblks(0),
+ _jfsize_pgs(0),
_enq_busy(false),
_deq_busy(false),
_abort_busy(false),
_commit_busy(false),
_txn_pending_set()
-{
- assert(_jc->jfsize_sblks() % JRNL_RMGR_PAGE_SIZE == 0);
-}
+{}
wmgr::~wmgr()
{
@@ -99,6 +95,11 @@
_max_dtokpp = max_dtokpp;
_max_io_wait_us = max_iowait_us;
_cb = wr_cb;
+
+ _jfsize_dblks = _jc->jfsize_sblks() * JRNL_SBLK_SIZE;
+ _jfsize_pgs = _jc->jfsize_sblks() / JRNL_WMGR_PAGE_SIZE;
+ assert(_jc->jfsize_sblks() % JRNL_RMGR_PAGE_SIZE == 0);
+
initialize();
if (eo)
{
Modified: store/trunk/cpp/lib/jrnl/wmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.hpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/lib/jrnl/wmgr.hpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -77,8 +77,8 @@
iocb** _iocba; ///< Array of iocb pointers for file header writes
u_int32_t _cached_offset_dblks; ///< Amount of unwritten data in page (dblocks)
std::deque<data_tok*> _ddtokl; ///< Deferred dequeue data_tok list
- const u_int32_t _jfsize_dblks; ///< Journal file size in dblks (NOT sblks!)
- const u_int32_t _jfsize_pgs; ///< Journal file size in cache pages
+ u_int32_t _jfsize_dblks; ///< Journal file size in dblks (NOT sblks!)
+ u_int32_t _jfsize_pgs; ///< Journal file size in cache pages
// TODO: Convert _enq_busy etc into a proper threadsafe lock
// TODO: Convert to enum? Are these encodes mutually exclusive?
Modified: store/trunk/cpp/tests/jrnl/_st_basic.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_basic.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/tests/jrnl/_st_basic.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -34,6 +34,8 @@
#include <iostream>
#include <cmath>
+#include <iostream> // debug
+
using namespace boost::unit_test;
using namespace rhm::journal;
using namespace std;
@@ -51,7 +53,7 @@
string test_name = get_test_name(test_filename, "instantiation");
try
{
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
+ jcntl jc(test_name, JRNL_DIR, test_name);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
}
catch(const exception& e) { BOOST_FAIL(e.what()); }
@@ -63,9 +65,9 @@
string test_name = get_test_name(test_filename, "initialization");
try
{
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
+ jcntl jc(test_name, JRNL_DIR, test_name);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
- jrnl_init(jc);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
BOOST_CHECK_EQUAL(jc.is_ready(), true);
}
catch(const exception& e) { BOOST_FAIL(e.what()); }
@@ -79,8 +81,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
for (int m=0; m<NUM_MSGS; m++)
@@ -97,8 +99,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<2*NUM_MSGS; m+=2)
{
BOOST_CHECK_EQUAL(enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false), u_int64_t(m));
@@ -116,8 +118,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
unsigned n = num_msgs_to_full(NUM_TEST_JFILES, TEST_JFSIZE_SBLKS * JRNL_SBLK_SIZE,
MSG_REC_SIZE_DBLKS, true);
for (unsigned m=0; m<3*2*n; m+=2) // overwrite files 3 times
@@ -137,10 +139,10 @@
try
{
{
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
+ jcntl jc(test_name, JRNL_DIR, test_name);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
- jrnl_init(jc);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
BOOST_CHECK_EQUAL(jc.is_ready(), true);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
}
@@ -148,10 +150,10 @@
vector<string> txn_list;
u_int64_t hrid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
+ jcntl jc(test_name, JRNL_DIR, test_name);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
- jrnl_recover(jc, txn_list, hrid);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
BOOST_CHECK_EQUAL(jc.is_ready(), true);
BOOST_CHECK_EQUAL(jc.is_read_only(), true);
BOOST_CHECK_EQUAL(hrid, u_int64_t(0));
@@ -160,10 +162,10 @@
vector<string> txn_list;
u_int64_t hrid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
+ jcntl jc(test_name, JRNL_DIR, test_name);
BOOST_CHECK_EQUAL(jc.is_ready(), false);
BOOST_CHECK_EQUAL(jc.is_read_only(), false);
- jrnl_recover(jc, txn_list, hrid);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
BOOST_CHECK_EQUAL(jc.is_ready(), true);
BOOST_CHECK_EQUAL(jc.is_read_only(), true);
BOOST_CHECK_EQUAL(hrid, u_int64_t(0));
@@ -184,8 +186,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
}
@@ -193,8 +195,8 @@
vector<string> txn_list;
u_int64_t hrid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_recover(jc, txn_list, hrid);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
jc.recover_complete();
for (int m=0; m<NUM_MSGS; m++)
@@ -217,20 +219,20 @@
for (int m=0; m<2*NUM_MSGS; m+=2)
{
{
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
+ jcntl jc(test_name, JRNL_DIR, test_name);
if (m == 0)
- jrnl_init(jc); // First time only
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS); // First time only
else
{
- jrnl_recover(jc, txn_list, hrid);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(m - 1));
jc.recover_complete();
}
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
}
{
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_recover(jc, txn_list, hrid);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(m));
jc.recover_complete();
deq_msg(jc, m);
@@ -249,8 +251,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
// Transient msgs - should not recover
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), true);
@@ -269,8 +271,8 @@
vector<string> txn_list;
u_int64_t hrid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_recover(jc, txn_list, hrid);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
// Recover non-transient msgs
for (int m=NUM_MSGS; m<NUM_MSGS*2; m++)
{
@@ -344,8 +346,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS);
unsigned m;
// Fill journal to just below threshold
@@ -380,8 +382,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_DEFAULT_JFILES, DEFAULT_JFSIZE_SBLKS);
unsigned m;
// Fill journal to just below threshold
@@ -409,8 +411,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
u_int64_t rid = enq_msg(jc, 0, create_msg(msg, 0, MSG_SIZE), false);
deq_msg(jc, rid);
try{ deq_msg(jc, rid); BOOST_ERROR("Did not throw exception on second dequeue."); }
Modified: store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/tests/jrnl/_st_basic_txn.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -54,8 +54,8 @@
string msg;
string xid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
BOOST_CHECK_EQUAL(enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false),
@@ -76,8 +76,8 @@
string msg;
string xid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
BOOST_CHECK_EQUAL(enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false),
@@ -105,8 +105,8 @@
string msg;
string xid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
create_xid(xid, m, XID_SIZE);
@@ -128,8 +128,8 @@
string msg;
string xid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
create_xid(xid, m, XID_SIZE);
@@ -156,8 +156,8 @@
string msg;
string xid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
BOOST_CHECK_EQUAL(enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false),
@@ -178,8 +178,8 @@
string msg;
string xid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
BOOST_CHECK_EQUAL(enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false),
@@ -200,8 +200,8 @@
string msg;
string xid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
create_xid(xid, m, XID_SIZE);
@@ -223,8 +223,8 @@
string msg;
string xid;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
create_xid(xid, m, XID_SIZE);
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -83,15 +83,16 @@
}
void
-jrnl_init(jcntl& jc)
+jrnl_init(jcntl& jc, const u_int16_t num_jfiles, const u_int32_t jfsize_sblks)
{
- jc.initialize(0, 0);
+ jc.initialize(num_jfiles, jfsize_sblks, 0, 0);
}
void
-jrnl_recover(jcntl& jc, vector<string>& txn_list, u_int64_t& highest_rid)
+jrnl_recover(jcntl& jc, const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
+ vector<string>& txn_list, u_int64_t& highest_rid)
{
- jc.recover(0, 0, txn_list, highest_rid);
+ jc.recover(num_jfiles, jfsize_sblks, 0, 0, txn_list, highest_rid);
}
const u_int64_t
Modified: store/trunk/cpp/tests/jrnl/_st_read.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_read.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/tests/jrnl/_st_read.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -57,8 +57,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
}
catch(const exception& e) { BOOST_FAIL(e.what()); }
@@ -76,8 +76,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
jc.flush();
@@ -109,8 +109,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<2*NUM_MSGS; m+=2)
{
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -137,8 +137,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
}
@@ -151,8 +151,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_recover(jc, txn_list, hrid);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
jc.recover_complete();
for (int m=0; m<NUM_MSGS; m++)
@@ -180,8 +180,8 @@
{
string msg;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
}
@@ -194,8 +194,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_recover(jc, txn_list, hrid);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
for (int m=0; m<NUM_MSGS; m++)
{
@@ -216,8 +216,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_recover(jc, txn_list, hrid);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_recover(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS, txn_list, hrid);
BOOST_CHECK_EQUAL(hrid, u_int64_t(NUM_MSGS - 1));
for (int m=0; m<NUM_MSGS; m++)
{
@@ -257,8 +257,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
unsigned m;
for (m=0; m<2*NUM_MSGS; m+=2)
{
@@ -285,8 +285,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
unsigned m;
unsigned read_buffer_size_dblks = JRNL_RMGR_PAGES * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
unsigned n = num_msgs_to_full(1, read_buffer_size_dblks, MSG_REC_SIZE_DBLKS, true);
@@ -315,8 +315,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
unsigned read_buffer_size_dblks = JRNL_RMGR_PAGES * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
unsigned n = num_msgs_to_full(1, read_buffer_size_dblks, MSG_REC_SIZE_DBLKS, true);
unsigned m = 0;
Modified: store/trunk/cpp/tests/jrnl/_st_read_txn.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_read_txn.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/tests/jrnl/_st_read_txn.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -57,8 +57,8 @@
string rxid;
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
create_xid(xid, 0, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false);
@@ -92,8 +92,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
create_xid(xid, m, XID_SIZE);
@@ -124,8 +124,8 @@
string rxid;
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
create_xid(xid, 1, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false);
@@ -151,8 +151,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
create_xid(xid, m, XID_SIZE);
@@ -180,8 +180,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
create_xid(xid, 2, XID_SIZE);
for (int m=0; m<NUM_MSGS; m++)
enq_txn_msg(jc, m, create_msg(msg, m, MSG_SIZE), xid, false);
@@ -207,8 +207,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
{
create_xid(xid, m, XID_SIZE);
@@ -236,8 +236,8 @@
bool externalFlag;
create_xid(xid, 3, XID_SIZE);
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
for (int m=0; m<NUM_MSGS; m++)
@@ -264,8 +264,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<3*NUM_MSGS; m+=3)
{
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
@@ -295,8 +295,8 @@
bool externalFlag;
create_xid(xid, 4, XID_SIZE);
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<NUM_MSGS; m++)
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
for (int m=0; m<NUM_MSGS; m++)
@@ -331,8 +331,8 @@
bool transientFlag;
bool externalFlag;
- jcntl jc(test_name, JRNL_DIR, test_name, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
- jrnl_init(jc);
+ jcntl jc(test_name, JRNL_DIR, test_name);
+ jrnl_init(jc, NUM_TEST_JFILES, TEST_JFSIZE_SBLKS);
for (int m=0; m<3*NUM_MSGS; m+=3)
{
enq_msg(jc, m, create_msg(msg, m, MSG_SIZE), false);
Modified: store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp 2008-04-02 18:24:24 UTC (rev 1832)
+++ store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp 2008-04-02 20:23:05 UTC (rev 1833)
@@ -40,7 +40,7 @@
jrnl_instance::jrnl_instance(const std::string& jid, const std::string& jdir,
const std::string& base_filename, const u_int16_t num_jfiles, const u_int32_t jfsize_sblks):
- rhm::journal::jcntl(jid, jdir, base_filename, num_jfiles, jfsize_sblks),
+ rhm::journal::jcntl(jid, jdir, base_filename),
_jpp(new jrnl_init_params(jid, jdir, base_filename, num_jfiles, jfsize_sblks)),
_args_ptr(0),
_dtok_master_enq_list(),
@@ -61,8 +61,7 @@
}
jrnl_instance::jrnl_instance(const jrnl_init_params::shared_ptr& p):
- rhm::journal::jcntl(p->jid(), p->jdir(), p->base_filename(), p->num_jfiles(),
- p->jfsize_sblks()),
+ rhm::journal::jcntl(p->jid(), p->jdir(), p->base_filename()),
_jpp(p),
_args_ptr(0),
_dtok_master_enq_list(),
@@ -111,19 +110,21 @@
{
std::vector<std::string> prep_txn_list;
u_int64_t highest_rid;
- recover(aio_rd_callback, aio_wr_callback, prep_txn_list, highest_rid);
+ recover(_jpp->num_jfiles(), _jpp->jfsize_sblks(), aio_rd_callback, aio_wr_callback,
+ prep_txn_list, highest_rid);
recover_complete();
}
catch (const rhm::journal::jexception& e)
{
if (e.err_code() == rhm::journal::jerrno::JERR_JDIR_STAT)
- initialize(aio_rd_callback, aio_wr_callback);
+ initialize(_jpp->num_jfiles(), _jpp->jfsize_sblks(), aio_rd_callback,
+ aio_wr_callback);
else
throw;
}
}
else
- initialize(aio_rd_callback, aio_wr_callback);
+ initialize(_jpp->num_jfiles(), _jpp->jfsize_sblks(), aio_rd_callback, aio_wr_callback);
}
catch (const rhm::journal::jexception& e) { _tcrp->add_exception(e); }
catch (const std::exception& e) { _tcrp->add_exception(e.what()); }
16 years, 2 months
rhmessaging commits: r1832 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-02 14:24:24 -0400 (Wed, 02 Apr 2008)
New Revision: 1832
Modified:
mgmt/cumin/python/cumin/model.py
mgmt/cumin/python/cumin/system.py
mgmt/cumin/python/cumin/system.strings
mgmt/cumin/python/cumin/widgets.py
mgmt/cumin/python/cumin/widgets.strings
Log:
Introduce an object summary that works from the ui metadata. This is
to replace all the custom object props and actions html.
As a first deployment, change the system ui to use it.
Add summary=False attrs to props, actions, and stats, to control
whether they are shown as part of the summary or only in the larger
property and action displays.
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-02 18:20:33 UTC (rev 1831)
+++ mgmt/cumin/python/cumin/model.py 2008-04-02 18:24:24 UTC (rev 1832)
@@ -85,6 +85,7 @@
self.name = name
self.title = None
self.categories = ()
+ self.summary = False
self.cumin_class.add_property(self)
@@ -111,9 +112,16 @@
self.cumin_class = cls
self.name = name
self.title = None
-
+ self.summary = False
+
self.cumin_class.add_action(self)
+ def get_title(self, session):
+ if self.title:
+ return self.title
+ else:
+ return self.name
+
def invoke(self, object, args={}):
invoc = CuminActionInvocation(self, object)
@@ -173,6 +181,7 @@
self.unit = None
self.title = None
self.categories = ()
+ self.summary = False
self.link_cb = None
self.highlow = False
@@ -353,6 +362,7 @@
prop = CuminProperty(self, "recTime")
prop.title = "Last Updated"
prop.categories = ("basic",)
+ prop.summary = True
class LocalClass(CuminClass):
def __init__(self, model, name, mint_class):
@@ -413,6 +423,7 @@
prop = CuminProperty(self, "nodeName")
prop.title = "Address"
+ prop.summary = True
prop = CuminProperty(self, "osName")
prop.title = "Kernel"
@@ -426,6 +437,10 @@
prop = CuminProperty(self, "machine")
prop.title = "Architecture"
+ action = CuminAction(self, "ping")
+ action.title = "Send Ping"
+ action.summary = True
+
class CuminBroker(RemoteClass):
def __init__(self, model):
super(CuminBroker, self).__init__(model, "broker", Broker, BrokerStats)
Modified: mgmt/cumin/python/cumin/system.py
===================================================================
--- mgmt/cumin/python/cumin/system.py 2008-04-02 18:20:33 UTC (rev 1831)
+++ mgmt/cumin/python/cumin/system.py 2008-04-02 18:24:24 UTC (rev 1832)
@@ -61,6 +61,9 @@
def __init__(self, app, name):
super(SystemView, self).__init__(app, name)
+ self.summary = CuminSummary(app, "summary")
+ self.add_child(self.summary)
+
self.status = SystemStatus(app, "status")
self.add_child(self.status)
Modified: mgmt/cumin/python/cumin/system.strings
===================================================================
--- mgmt/cumin/python/cumin/system.strings 2008-04-02 18:20:33 UTC (rev 1831)
+++ mgmt/cumin/python/cumin/system.strings 2008-04-02 18:24:24 UTC (rev 1832)
@@ -27,13 +27,6 @@
[SystemView.html]
<h1><img src="resource?name=system-36.png"/>{title}</h1>
-<table class="props">
- <tr><th>Address</th><td>{address}</td></tr>
- <tr><th>Kernel</th><td>{kernel} {kernel_release}<br/>{kernel_version}</td></tr>
- <tr><th>Architecture</th><td>{architecture}</td></tr>
- <tr><th>Updated</th><td>{updated}</td></tr>
- <tr><th>Created – Deleted</th><td>{created_deleted}</td></tr>
- <tr><th>Updated</th><td>{updated}</td></tr>
-</table>
+{summary}
{tabs}
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2008-04-02 18:20:33 UTC (rev 1831)
+++ mgmt/cumin/python/cumin/widgets.py 2008-04-02 18:24:24 UTC (rev 1832)
@@ -261,7 +261,29 @@
def render_title(self, session):
return "Details"
-
+
+class CuminSummary(Widget):
+ def __init__(self, app, name):
+ super(CuminSummary, self).__init__(app, name)
+
+ props = self.SummaryProperties(app, "properties")
+ self.add_child(props)
+
+ actions = self.SummaryActions(app, "actions")
+ self.add_child(actions)
+
+ class SummaryProperties(CuminProperties):
+ def do_get_items(self, session, object):
+ cls = self.app.model.get_class_by_object(object)
+ return [(x.get_title(session), x.value(object))
+ for x in cls.properties if x.summary]
+
+ class SummaryActions(CuminActions):
+ def do_get_items(self, session, object):
+ cls = self.app.model.get_class_by_object(object)
+ return [("", x.get_title(session))
+ for x in cls.actions if x.summary]
+
class StateSwitch(ItemSet):
def __init__(self, app, name):
super(StateSwitch, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/cumin/python/cumin/widgets.strings 2008-04-02 18:20:33 UTC (rev 1831)
+++ mgmt/cumin/python/cumin/widgets.strings 2008-04-02 18:24:24 UTC (rev 1832)
@@ -121,6 +121,7 @@
[CuminDetails.css]
table.CuminDetails {
width: 100%;
+ border-collapse: collapse;
}
table.CuminDetails td {
@@ -140,6 +141,72 @@
</tr>
</table>
+[CuminSummary.css]
+table.CuminSummary {
+ width: 36em;
+ font-size: 0.9em;
+ margin: 0 0 1em 0;
+ border-collapse: collapse;
+}
+
+table.CuminSummary td.properties {
+ width: 50%;
+ padding: 0.5em;
+ border-top: 1px dotted #ccc;
+ border-right: 1px dotted #ccc;
+}
+
+table.CuminSummary td.actions {
+ width: 50%;
+ padding: 0.5em;
+ border-top: 1px dotted #ccc;
+}
+
+table.CuminSummary table.PropertySet {
+ margin: 0.5em 0;
+}
+
+table.CuminSummary ul.ActionSet {
+ margin: 0.5em 0;
+}
+
+table.CuminSummary ul.ActionSet li {
+ list-style-type: square;
+}
+
+[CuminSummary.html]
+<table class="CuminSummary">
+ <tr>
+ <td class="properties">
+ {properties}
+ </td>
+ <td class="actions">
+ <div>Act on this object:</div>
+ {actions}
+ </td>
+ </tr>
+</table>
+
+[SummaryProperties.css]
+dl.SummaryProperties {
+ margin: 0 0 0.5em 0;
+}
+
+dl.SummaryProperties dt {
+ font-size: 0.9em;
+ font-weight: bold;
+}
+
+dl.SummaryProperties dt {
+ font-size: 0.9em;
+}
+
+[SummaryProperties.html]
+<dl class="SummaryProperties">{items}</dl>
+
+[SummaryProperties.property_html]
+<dt>{title}</dt><dd>{value}</dd>
+
[StateSwitch.html]
<ul class="radiotabs">
{items}
16 years, 2 months
rhmessaging commits: r1831 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-02 14:20:33 -0400 (Wed, 02 Apr 2008)
New Revision: 1831
Modified:
mgmt/cumin/python/cumin/page.strings
Log:
Remove obsolete styling.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2008-04-02 18:18:55 UTC (rev 1830)
+++ mgmt/cumin/python/cumin/page.strings 2008-04-02 18:20:33 UTC (rev 1831)
@@ -172,23 +172,6 @@
background-color: white;
}
-dl.properties {
- margin: 0 0 1.5em 0;
- width: 25em;
-}
-
-dl.properties dt, dd {
- border-top: 1px dotted #ddd;
- padding: 0.25em 0.5em;
-}
-
-dl.properties dt {
- width: 10em;
- float: left;
- background-color: #f7f7f7;
- margin-right: 0.5em;
-}
-
ul.mobjects {
list-style: none;
margin: 0;
16 years, 2 months
rhmessaging commits: r1830 - mgmt/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-02 14:18:55 -0400 (Wed, 02 Apr 2008)
New Revision: 1830
Modified:
mgmt/cumin/python/wooly/widgets.strings
Log:
Small style adjustment for ActionSets.
Modified: mgmt/cumin/python/wooly/widgets.strings
===================================================================
--- mgmt/cumin/python/wooly/widgets.strings 2008-04-01 21:52:56 UTC (rev 1829)
+++ mgmt/cumin/python/wooly/widgets.strings 2008-04-02 18:18:55 UTC (rev 1830)
@@ -132,22 +132,27 @@
<li><a {class_attr} href="{href}">{content}</a></li>
[PropertySet.css]
-table.PropertySet tr.prop th, table.PropertySet tr.prop td {
- padding: 0.25em 1em 0.25em 0;
+table.PropertySet th, table.PropertySet td {
+ padding: 0 0.5em 0 0;
}
table.PropertySet th {
- font-size: 0.9em;
+ color: #333;
}
[PropertySet.html]
<table class="PropertySet">{items}</table>
[PropertySet.property_html]
-<tr class="prop"><th>{title}</th><td>{value}</td></tr>
+<tr><th>{title}</th><td>{value}</td></tr>
+[ActionSet.css]
+ul.ActionSet li {
+ margin: 0 0 0 1em;
+}
+
[ActionSet.html]
-<ul>{items}</ul>
+<ul class="ActionSet">{items}</ul>
[ActionSet.action_html]
<li><a href="{href}">{content}</a></li>
16 years, 2 months
rhmessaging commits: r1828 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-01 16:18:44 -0400 (Tue, 01 Apr 2008)
New Revision: 1828
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
Log:
Fixed the memory leak fix...
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-04-01 19:04:26 UTC (rev 1827)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-04-01 20:18:44 UTC (rev 1828)
@@ -34,6 +34,7 @@
using namespace rhm::journal;
qpid::broker::Timer* JournalImpl::journalTimerPtr = 0;
+u_int32_t JournalImpl::cnt = 0;
void InactivityFireEvent::fire() { if (parent) parent->flushFire(); }
void GetEventsFireEvent::fire() {
@@ -64,6 +65,7 @@
if (journalTimerPtr == 0)
journalTimerPtr = new qpid::broker::Timer;
assert (journalTimerPtr != 0);
+ cnt++;
journalTimerPtr->start();
journalTimerPtr->add(inactivityFireEventPtr);
@@ -98,7 +100,7 @@
::free(_datap);
_datap = 0;
}
- if (journalTimerPtr)
+ if (journalTimerPtr && --cnt == 0)
{
delete journalTimerPtr;
journalTimerPtr = 0;
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-04-01 19:04:26 UTC (rev 1827)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-04-01 20:18:44 UTC (rev 1828)
@@ -33,6 +33,7 @@
#include <qpid/sys/Time.h>
#include <boost/ptr_container/ptr_list.hpp>
#include <boost/intrusive_ptr.hpp>
+#include <boost/shared_ptr.hpp>
namespace rhm {
namespace bdbstore {
@@ -67,6 +68,7 @@
{
private:
static qpid::broker::Timer* journalTimerPtr;
+ static u_int32_t cnt;
bool getEventsTimerSetFlag;
boost::intrusive_ptr<qpid::broker::TimerTask> getEventsFireEventsPtr;
16 years, 2 months