rhmessaging commits: r2960 - in mgmt/trunk: mint/bin and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-10 11:42:59 -0500 (Wed, 10 Dec 2008)
New Revision: 2960
Added:
mgmt/trunk/parsley/python/parsley/loggingex.py
Modified:
mgmt/trunk/cumin/python/cumin/__init__.py
mgmt/trunk/cumin/python/cumin/tools.py
mgmt/trunk/mint/bin/mint-server
mgmt/trunk/mint/python/mint/tools.py
Log:
Add a common facility for enabling logging to parsley.
Use it to correct some over-verbose logging in mint and cumin.
Modified: mgmt/trunk/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/__init__.py 2008-12-10 15:46:58 UTC (rev 2959)
+++ mgmt/trunk/cumin/python/cumin/__init__.py 2008-12-10 16:42:59 UTC (rev 2960)
@@ -1,7 +1,8 @@
-import sys, os, logging
+import sys, os
from random import randint
from parsley.config import Config, ConfigParameter
+from parsley.loggingex import *
from wooly import Application, Session, Page
from wooly.pages import CssPage, JavascriptPage, ResourcePage
from wooly.server import WebServer
@@ -22,7 +23,7 @@
from wooly import Session
-log = logging.getLogger("cumin")
+log = getLogger("cumin")
class Cumin(Application):
def __init__(self, config):
@@ -131,13 +132,6 @@
return False
class CuminConfig(Config):
- __log_levels = {
- "debug": logging.DEBUG,
- "info": logging.INFO,
- "warning": logging.WARNING,
- "error": logging.ERROR
- }
-
def __init__(self):
super(CuminConfig, self).__init__()
@@ -157,7 +151,7 @@
param.default = os.path.join(self.home, "log", "cumin.log")
param = ConfigParameter(self, "log-level", str)
- param.default = "warning"
+ param.default = "warn"
param = ConfigParameter(self, "debug", bool)
param.default = False
@@ -173,7 +167,7 @@
def init(self):
super(CuminConfig, self).init()
- handler = logging.StreamHandler()
+ handler = StreamHandler()
log.addHandler(handler)
self.load_file(os.path.join(self.home, "etc", "cumin.conf"))
self.load_file(os.path.join(os.path.expanduser("~"), ".cumin.conf"))
@@ -182,45 +176,9 @@
self.init_logging()
def init_logging(self):
- mlog = logging.getLogger("mint")
+ enable_logging("mint", self.log_level, self.log_file)
+ enable_logging("cumin", self.log_level, self.log_file)
- level = self.get_log_level()
- formatter = logging.Formatter \
- ("%(asctime)s %(levelname)-8s %(message)s")
-
- log.setLevel(level)
- mlog.setLevel(level)
-
- try:
- handler = logging.FileHandler(self.log_file)
- handler.setLevel(level)
- handler.setFormatter(formatter)
-
- log.addHandler(handler)
- mlog.addHandler(handler)
- except IOError, e:
- log.warn("Can't write to log file '%s': %s" % (self.log_file, e))
-
if self.debug:
- level = logging.DEBUG
- formatter = logging.Formatter("%(name)-12s - %(message)s")
-
- log.setLevel(level)
- mlog.setLevel(level)
-
- handler = logging.StreamHandler()
- handler.setLevel(level)
- handler.setFormatter(formatter)
-
- log.addHandler(handler)
- mlog.addHandler(handler)
-
- def get_log_level(self):
- try:
- level = self.__log_levels[self.log_level.lower()]
- except KeyError:
- log.warn("Level '%s' is unknown; setting level to 'warning'" % \
- self.log_level)
- level = logging.WARNING
-
- return level
+ enable_logging("mint", "debug", sys.stderr)
+ enable_logging("cumin", "debug", sys.stderr)
Modified: mgmt/trunk/cumin/python/cumin/tools.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/tools.py 2008-12-10 15:46:58 UTC (rev 2959)
+++ mgmt/trunk/cumin/python/cumin/tools.py 2008-12-10 16:42:59 UTC (rev 2960)
@@ -43,7 +43,7 @@
opt = CommandOption(self, "log-level")
opt.argument = "LEVEL"
opt.description = "Log messages at or above LEVEL " + \
- "('debug', 'info', 'warning', 'error')"
+ "('debug', 'info', 'warn', 'error')"
opt = CommandOption(self, "debug")
opt.description = "Enable debugging; print logging to console"
Modified: mgmt/trunk/mint/bin/mint-server
===================================================================
--- mgmt/trunk/mint/bin/mint-server 2008-12-10 15:46:58 UTC (rev 2959)
+++ mgmt/trunk/mint/bin/mint-server 2008-12-10 16:42:59 UTC (rev 2960)
@@ -5,13 +5,6 @@
from mint.tools import MintServerTool
def main():
- root = logging.getLogger("mint")
- root.setLevel(logging.DEBUG)
-
- h = logging.StreamHandler()
- h.setLevel(logging.DEBUG)
- root.addHandler(h)
-
MintServerTool("mint-server").main()
if __name__ == "__main__":
Modified: mgmt/trunk/mint/python/mint/tools.py
===================================================================
--- mgmt/trunk/mint/python/mint/tools.py 2008-12-10 15:46:58 UTC (rev 2959)
+++ mgmt/trunk/mint/python/mint/tools.py 2008-12-10 16:42:59 UTC (rev 2960)
@@ -3,6 +3,7 @@
from time import sleep, clock
from parsley.config import *
from parsley.command import *
+from parsley.loggingex import *
from mint import *
@@ -21,7 +22,7 @@
opt = CommandOption(self, "log-level")
opt.argument = "LEVEL"
opt.description = "Log messages at or above LEVEL " + \
- "('debug', 'info', 'warning', 'error')"
+ "('debug', 'info', 'warn', 'error')"
opt = CommandOption(self, "debug")
opt.description = "Enable debugging; print logging to console"
@@ -45,9 +46,6 @@
#self.config.init()
def run(self):
- pass
-
- def run(self):
try:
opts, args = self.parse(sys.argv)
except CommandException, e:
@@ -59,6 +57,14 @@
self.print_help()
sys.exit(0)
+ level = opts.get("log-level", "warn")
+ file = opts.get("log-file", sys.stderr)
+
+ enable_logging("mint", level, file)
+
+ if "debug" in opts:
+ enable_logging("mint", "debug", sys.stderr)
+
self.do_run(opts, args)
def do_run(self, opts, args):
Added: mgmt/trunk/parsley/python/parsley/loggingex.py
===================================================================
--- mgmt/trunk/parsley/python/parsley/loggingex.py (rev 0)
+++ mgmt/trunk/parsley/python/parsley/loggingex.py 2008-12-10 16:42:59 UTC (rev 2960)
@@ -0,0 +1,26 @@
+from logging import *
+
+levels = {
+ "debug": DEBUG,
+ "info": INFO,
+ "warn": WARN,
+ "error": ERROR,
+ "critical": CRITICAL
+ }
+
+def enable_logging(name, level, file):
+ assert level
+ assert file
+
+ if type(level) is str:
+ level = levels[level.lower()]
+
+ if type(file) is str:
+ file = open(file, "a")
+
+ handler = StreamHandler(file)
+ handler.setFormatter(Formatter("%(asctime)s %(levelname)s %(message)s"))
+
+ log = getLogger(name)
+ log.addHandler(handler)
+ log.setLevel(level)
16 years, 3 months
rhmessaging commits: r2959 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-10 10:46:58 -0500 (Wed, 10 Dec 2008)
New Revision: 2959
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Added "Unknown" value to slot status legend
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-12-09 22:19:02 UTC (rev 2958)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-12-10 15:46:58 UTC (rev 2959)
@@ -603,7 +603,8 @@
("Suspended", "red"),
("Vacating", "orange"),
("Killing", "blue"),
- ("Benchmarking", "yellow")]
+ ("Benchmarking", "yellow"),
+ ("Unknown", "black")]
def get_field_tuples(self, session):
return [("name", "Name"), ("machine", "Machine"), ("job_id", "Job")]
16 years, 3 months
rhmessaging commits: r2958 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-09 17:19:02 -0500 (Tue, 09 Dec 2008)
New Revision: 2958
Modified:
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Adjust spacing a little
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-12-09 22:12:07 UTC (rev 2957)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-12-09 22:19:02 UTC (rev 2958)
@@ -119,7 +119,7 @@
button, ul.actions a, a.action {
margin: 0;
border: 1px solid #ddd;
- padding: 0.25em 0.5em 0.15em 0.5em;
+ padding: 0.25em 0.5em 0.25em 0.5em;
background-color: #f7f7f7;
color: #000;
font-size: 0.9em;
16 years, 3 months
rhmessaging commits: r2957 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-09 17:12:07 -0500 (Tue, 09 Dec 2008)
New Revision: 2957
Modified:
mgmt/trunk/cumin/python/cumin/page.py
Log:
Add the mrg icon to the home view
Modified: mgmt/trunk/cumin/python/cumin/page.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.py 2008-12-09 21:17:25 UTC (rev 2956)
+++ mgmt/trunk/cumin/python/cumin/page.py 2008-12-09 22:12:07 UTC (rev 2957)
@@ -253,6 +253,9 @@
def render_title(self, session):
return "MRG Management"
+ def render_icon_href(self, session):
+ return "resource?name=mrg-36.png"
+
class OverviewTab(Widget):
def __init__(self, app, name):
super(HomeView.OverviewTab, self).__init__(app, name)
16 years, 3 months
rhmessaging commits: r2956 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-09 16:17:25 -0500 (Tue, 09 Dec 2008)
New Revision: 2956
Modified:
mgmt/trunk/cumin/python/cumin/broker.py
mgmt/trunk/cumin/python/cumin/job.py
mgmt/trunk/cumin/python/cumin/job.strings
mgmt/trunk/cumin/python/cumin/page.py
mgmt/trunk/cumin/python/cumin/page.strings
mgmt/trunk/cumin/python/cumin/queue.py
mgmt/trunk/cumin/python/cumin/queue.strings
mgmt/trunk/cumin/python/cumin/system.py
mgmt/trunk/cumin/python/cumin/system.strings
mgmt/trunk/cumin/python/cumin/widgets.py
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Fill in the overview screen with 'top 5' lists of notable objects
Modified: mgmt/trunk/cumin/python/cumin/broker.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/broker.py 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/broker.py 2008-12-09 21:17:25 UTC (rev 2956)
@@ -120,6 +120,23 @@
return link
+class TopBrokerSet(CuminTable):
+ def __init__(self, app, name):
+ super(TopBrokerSet, self).__init__(app, name)
+
+ col = self.NameColumn(app, "name")
+ self.add_column(col)
+ self.set_default_column(col)
+
+ class NameColumn(SqlTableColumn):
+ def render_title(self, session, data):
+ return "Name"
+
+ def render_content(self, session, data):
+ reg = Identifiable(data["id"])
+ href = self.page.main.broker.get_href(session, reg)
+ return fmt_link(href, fmt_shorten(data["name"]))
+
class BrokerFrame(CuminFrame):
def __init__(self, app, name):
super(BrokerFrame, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-12-09 21:17:25 UTC (rev 2956)
@@ -5,6 +5,7 @@
from wooly.forms import *
from wooly.resources import *
from wooly.tables import *
+from time import clock
from stat import *
from widgets import *
@@ -198,6 +199,36 @@
def render_title(self, session, data):
return "Title"
+class TopJobSet(TopTable):
+ def __init__(self, app, name):
+ super(TopJobSet, self).__init__(app, name)
+
+ col = self.NameColumn(app, "name")
+ self.add_column(col)
+
+ self.set_default_column(col)
+
+ col = self.DurationColumn(app, "name")
+ col.alignment = "right"
+ self.add_column(col)
+
+ class NameColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Name"
+
+ def render_content(self, session, data):
+ job = Identifiable(data["id"])
+ href = self.page.main.pool.job.get_href(session, job)
+ return fmt_link(href, fmt_shorten(data["name"]))
+
+ class DurationColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Duration"
+
+ def render_content(self, session, data):
+ since = data["q_date"]
+ return fmt_duration(clock() - secs(since))
+
class JobTab(JobSet):
def __init__(self, app, name):
super(JobTab, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.strings 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/job.strings 2008-12-09 21:17:25 UTC (rev 2956)
@@ -44,6 +44,20 @@
inner join submitter as b on b.id = j.submitter_id
{sql_where}
+[TopJobSet.sql]
+select
+ j.id,
+ j.custom_id as name,
+ j.q_date
+from job as j
+where j.job_status = 2
+ and j.qmf_update_time > now() - interval '60 seconds'
+order by j.q_date asc
+limit 5
+
+[TopJobSet.count_sql]
+--
+
[JobTab.css]
input.search_input {
color: #555;
Modified: mgmt/trunk/cumin/python/cumin/page.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.py 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/page.py 2008-12-09 21:17:25 UTC (rev 2956)
@@ -254,6 +254,18 @@
return "MRG Management"
class OverviewTab(Widget):
+ def __init__(self, app, name):
+ super(HomeView.OverviewTab, self).__init__(app, name)
+
+ queues = TopQueueSet(app, "queues")
+ self.add_child(queues)
+
+ jobs = TopJobSet(app, "jobs")
+ self.add_child(jobs)
+
+ systems = TopSystemSet(app, "systems")
+ self.add_child(systems)
+
def render_title(self, session):
return "Overview"
Modified: mgmt/trunk/cumin/python/cumin/page.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.strings 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/page.strings 2008-12-09 21:17:25 UTC (rev 2956)
@@ -184,11 +184,51 @@
<div class="TabbedModeSet mode">{mode}</div>
</div>
+[OverviewTab.css]
+table.OverviewTab {
+ width: 100%;
+}
+
+table.OverviewTab > tbody > tr > td {
+ width: 50%;
+ vertical-align: top;
+}
+
+table.OverviewTab h2 img {
+ vertical-align: -15%;
+ margin: 0 0.2em 0 0;
+}
+
[OverviewTab.html]
<ul class="actions">
<li><a class="nav" href="{add_qmf_source_href}">Add Management Data Source</a></li>
</ul>
+<table class="OverviewTab">
+ <tbody>
+ <tr>
+ <td>
+ <h2><img src="resource?name=queue-20.png"/> Busiest Message Queues</h2>
+
+ <div class="iblock">{queues}</div>
+ </td>
+ <td>
+ <h2><img src="resource?name=job-20.png"/> Longest Running Grid Jobs</h2>
+ <div class="iblock">{jobs}</div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h2><img src="resource?name=system-20.png"/> Busiest Systems</h2>
+
+ <div class="iblock">{systems}</div>
+ </td>
+ <td>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
[AccountTab.html]
<ul class="actions">
<a class="nav" href="{change_password_href}">Change Password</a>
Modified: mgmt/trunk/cumin/python/cumin/queue.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.py 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/queue.py 2008-12-09 21:17:25 UTC (rev 2956)
@@ -164,6 +164,35 @@
unit = self.parent.unit.get(session)
return unit == "b" and "bdepth" or "mdepth"
+class TopQueueSet(TopTable):
+ def __init__(self, app, name):
+ super(TopQueueSet, self).__init__(app, name)
+
+ col = self.NameColumn(app, "name")
+ self.add_column(col)
+
+ self.set_default_column(col)
+
+ col = self.EnqueuesColumn(app, "enqueues")
+ col.alignment = "right"
+ self.add_column(col)
+
+ class NameColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Name"
+
+ def render_content(self, session, data):
+ queue = Identifiable(data["id"])
+ href = self.page.main.broker.queue.get_href(session, queue)
+ return fmt_link(href, fmt_shorten(data["name"]))
+
+ class EnqueuesColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Recent Enqueues"
+
+ def render_content(self, session, data):
+ return int(data["avg_enqueues"])
+
class QueueFrame(CuminFrame):
def __init__(self, app, name):
super(QueueFrame, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/queue.strings 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/queue.strings 2008-12-09 21:17:25 UTC (rev 2956)
@@ -63,6 +63,21 @@
<div>{hidden_inputs}</div>
</form>
+[TopQueueSet.sql]
+select
+ q.id,
+ q.name,
+ avg(s.msg_total_enqueues) as avg_enqueues
+from queue as q
+join queue_stats as s on s.queue_id = q.id
+where s.qmf_update_time > now() - interval '10 minutes'
+group by q.id, q.name
+order by avg_enqueues desc
+limit 5
+
+[TopQueueSet.count_sql]
+--
+
[QueueStatus.javascript]
function updateQueueStatus(id, queue) {
updateStatus(id, queue);
Modified: mgmt/trunk/cumin/python/cumin/system.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.py 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/system.py 2008-12-09 21:17:25 UTC (rev 2956)
@@ -33,6 +33,35 @@
href = self.page.main.system.get_href(session, system)
return fmt_link(href, fmt_shorten(data["name"]))
+class TopSystemSet(TopTable):
+ def __init__(self, app, name):
+ super(TopSystemSet, self).__init__(app, name)
+
+ col = self.NameColumn(app, "name")
+ self.add_column(col)
+
+ self.set_default_column(col)
+
+ col = self.LoadColumn(app, "load")
+ col.alignment = "right"
+ self.add_column(col)
+
+ class NameColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Name"
+
+ def render_content(self, session, data):
+ system = Identifiable(data["id"])
+ href = self.page.main.system.get_href(session, system)
+ return fmt_link(href, fmt_shorten(data["name"]))
+
+ class LoadColumn(TopTableColumn):
+ def render_title(self, session, data):
+ return "Load Average"
+
+ def render_content(self, session, data):
+ return "%0.3f" % data["load_avg"]
+
class SystemFrame(CuminFrame):
def __init__(self, app, name):
super(SystemFrame, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/system.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/system.strings 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/system.strings 2008-12-09 21:17:25 UTC (rev 2956)
@@ -24,6 +24,19 @@
<div>{hidden_inputs}</div>
</form>
+[TopSystemSet.sql]
+select
+ s.id,
+ s.node_name as name,
+ c.load_average1_min as load_avg
+from sysimage s
+join sysimage_stats as c on s.stats_curr_id = c.id
+order by load_avg desc
+limit 5
+
+[TopSystemSet.count_sql]
+--
+
[SlotUtilizationGrid.javascript]
function got_slot_grid(obj, id) {
for (var cell in obj.slots.slot) {
Modified: mgmt/trunk/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.py 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/widgets.py 2008-12-09 21:17:25 UTC (rev 2956)
@@ -643,6 +643,36 @@
return fmt_link("", title, class_, link_title=hover, bm=bm, click=click)
+class TopTableColumn(SqlTableColumn):
+ def __init__(self, app, name):
+ super(TopTableColumn, self).__init__(app, name)
+
+ self.header_class = TopTableColumnHeader
+
+class TopTableColumnHeader(ItemTableColumnHeader):
+ pass
+
+class TopTable(SqlTable):
+ def __init__(self, app, name):
+ super(TopTable, self).__init__(app, name)
+
+ col = self.CountColumn(app, "name")
+ col.alignment = "right"
+ self.add_column(col)
+
+ self.count = Attribute(app, "count")
+ self.count.default = 1
+ self.add_attribute(self.count)
+
+ def get_connection(self, session):
+ return sqlhub.getConnection().getConnection()
+
+ class CountColumn(TopTableColumn):
+ def render_content(self, session, data):
+ count = self.parent.count.get(session)
+ self.parent.count.set(session, count + 1)
+ return count
+
class CuminTable(SqlTable):
def __init__(self, app, name):
super(CuminTable, self).__init__(app, name)
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-12-09 20:44:04 UTC (rev 2955)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-12-09 21:17:25 UTC (rev 2956)
@@ -924,6 +924,44 @@
[EditablePropertyRenderer.orig_html]
<input type="hidden" name="{porig_name}" value="{porig_value}"/>
+[TopTable.css]
+table.TopTable {
+ width: 100%;
+ border-collapse: collapse;
+ margin: 0;
+}
+
+table.TopTable tr {
+ border-top: 1px dotted #ccc;
+ vertical-align: top;
+}
+
+table.TopTable td {
+ padding: 0.35em 0.5em;
+}
+
+table.TopTable th {
+ padding: 0.35em 0.5em;
+ text-align: left;
+ font-weight: normal;
+ font-style: italic;
+ color: #444;
+ font-size: 0.9em;
+}
+
+table.TopTable th.ralign {
+ text-align: right;
+}
+
+[TopTable.html]
+<table class="TopTable">
+ <thead><tr>{headers}</tr></thead>
+ <tbody>{items}</tbody>
+</table>
+
+[TopTableColumnHeader.html]
+<th {class_attr}>{content}</th>
+
[CuminTable.css]
table.mobjects th.setnav {
font-size: 0.9em;
16 years, 3 months
rhmessaging commits: r2955 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-09 15:44:04 -0500 (Tue, 09 Dec 2008)
New Revision: 2955
Modified:
mgmt/trunk/mint/python/mint/schema.py
Log:
Generated with capitalized Acl and Cluster class names.
Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py 2008-12-09 17:53:33 UTC (rev 2954)
+++ mgmt/trunk/mint/python/mint/schema.py 2008-12-09 20:44:04 UTC (rev 2955)
@@ -529,7 +529,7 @@
lazyUpdate = True
qmfUpdateTime = TimestampCol(default=None)
- acl = ForeignKey('Acl', cascade='null', default=None)
+ Acl = ForeignKey('Acl', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
aclDenyCount = BigIntCol(default=None)
@@ -577,7 +577,7 @@
lazyUpdate = True
qmfUpdateTime = TimestampCol(default=None)
- cluster = ForeignKey('Cluster', cascade='null', default=None)
+ Cluster = ForeignKey('Cluster', cascade='null', default=None)
classInfos = dict() # brokerId => classInfo
@@ -1351,16 +1351,16 @@
Master.sqlmeta.addJoin(SQLMultipleJoin('MasterStats', joinMethodName='stats'))
-classToSchemaNameMap['Acl'] = 'acl'
-schemaNameToClassMap['acl'] = Acl
+classToSchemaNameMap['Acl'] = 'Acl'
+schemaNameToClassMap['Acl'] = Acl
Broker.sqlmeta.addJoin(SQLMultipleJoin('Acl', joinMethodName='acls'))
Acl.sqlmeta.addJoin(SQLMultipleJoin('AclStats', joinMethodName='stats'))
-classToSchemaNameMap['Cluster'] = 'cluster'
-schemaNameToClassMap['cluster'] = Cluster
+classToSchemaNameMap['Cluster'] = 'Cluster'
+schemaNameToClassMap['Cluster'] = Cluster
Broker.sqlmeta.addJoin(SQLMultipleJoin('Cluster', joinMethodName='clusters'))
16 years, 3 months
rhmessaging commits: r2954 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-12-09 12:53:33 -0500 (Tue, 09 Dec 2008)
New Revision: 2954
Modified:
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/txn_map.cpp
store/trunk/cpp/lib/jrnl/txn_map.hpp
Log:
Fix for BZ 472937 - "TPL recoverTplStore() failed: jexception 0x0b01 txn_map::get_tdata_list() threw JERR_MAP_NOTFOUND: Key not found in map. (xid=rhm-tid0x2aac2c9b0ee0) (MessageStoreImpl.cpp:1079)".
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-12-09 15:53:21 UTC (rev 2953)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-12-09 17:53:33 UTC (rev 2954)
@@ -168,21 +168,7 @@
return RHM_IORES_TXPENDING;
// (Recover mode only) Ok, not in emap - now search tmap, if present then read
- std::vector<std::string> xid_list;
- _tmap.xid_list(xid_list);
- for (std::vector<std::string>::iterator itr = xid_list.begin();
- itr != xid_list.end() && !is_enq; itr++)
- {
- txn_data_list tx_list = _tmap.get_tdata_list(*itr);
- for (tdl_itr ditr = tx_list.begin(); ditr != tx_list.end() && !is_enq;
- ditr++)
- {
- if (ditr->_enq_flag)
- is_enq = ditr->_rid == _hdr._rid;
- else
- is_enq = ditr->_drid == _hdr._rid;
- }
- }
+ is_enq = _tmap.is_enq(_hdr._rid);
if (enforce_txns && is_enq)
return RHM_IORES_TXPENDING;
}
Modified: store/trunk/cpp/lib/jrnl/txn_map.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.cpp 2008-12-09 15:53:21 UTC (rev 2953)
+++ store/trunk/cpp/lib/jrnl/txn_map.cpp 2008-12-09 17:53:33 UTC (rev 2954)
@@ -93,12 +93,18 @@
txn_map::get_tdata_list(const std::string& xid)
{
slock s(&_mutex);
+ return get_tdata_list_nolock(xid);
+}
+
+const txn_data_list
+txn_map::get_tdata_list_nolock(const std::string& xid)
+{
xmap_itr itr = _map.find(xid);
if (itr == _map.end()) // not found in map
{
std::ostringstream oss;
oss << std::hex << "xid=" << xid_format(xid);
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map", "get_tdata_list");
+ throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map", "get_tdata_list_nolock");
}
return itr->second;
}
@@ -112,8 +118,7 @@
{
std::ostringstream oss;
oss << std::hex << "xid=" << xid_format(xid);
- throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map",
- "get_remove_tdata_list");
+ throw jexception(jerrno::JERR_MAP_NOTFOUND, oss.str(), "txn_map", "get_remove_tdata_list");
}
txn_data_list list = itr->second;
_map.erase(itr);
@@ -236,10 +241,10 @@
const txn_data&
txn_map::get_data(const std::string& xid, const u_int64_t rid)
{
- txn_data_list tdl = get_tdata_list(xid);
bool found = false;
{
slock s(&_mutex);
+ txn_data_list tdl = get_tdata_list_nolock(xid);
tdl_itr itr = tdl.begin();
while (itr != tdl.end() && !found)
{
@@ -256,6 +261,27 @@
}
}
+bool
+txn_map::is_enq(const u_int64_t rid)
+{
+ bool found = false;
+ {
+ slock s(&_mutex);
+ for (xmap_itr i = _map.begin(); i != _map.end() && !found; i++)
+ {
+ txn_data_list list = i->second;
+ for (tdl_itr j = list.begin(); j < list.end() && !found; j++)
+ {
+ if (j->_enq_flag)
+ found = j->_rid == rid;
+ else
+ found = j->_drid == rid;
+ }
+ }
+ }
+ return found;
+}
+
void
txn_map::xid_list(std::vector<std::string>& xv)
{
Modified: store/trunk/cpp/lib/jrnl/txn_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.hpp 2008-12-09 15:53:21 UTC (rev 2953)
+++ store/trunk/cpp/lib/jrnl/txn_map.hpp 2008-12-09 17:53:33 UTC (rev 2954)
@@ -139,6 +139,7 @@
bool is_txn_synced(const std::string& xid);
bool set_aio_compl(const std::string& xid, const u_int64_t rid);
const txn_data& get_data(const std::string& xid, const u_int64_t rid);
+ bool is_enq(const u_int64_t rid);
inline void clear() { _map.clear(); }
inline bool empty() const { return _map.empty(); }
inline u_int32_t size() const { return u_int32_t(_map.size()); }
@@ -147,6 +148,8 @@
u_int32_t cnt(const bool enq_flag);
u_int32_t cnt(const std::string& xid, const bool enq_flag);
static std::string xid_format(const std::string& xid);
+
+ const txn_data_list get_tdata_list_nolock(const std::string& xid);
};
} // namespace journal
16 years, 3 months
rhmessaging commits: r2953 - mgmt/trunk/sesame/cpp/etc.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-09 10:53:21 -0500 (Tue, 09 Dec 2008)
New Revision: 2953
Modified:
mgmt/trunk/sesame/cpp/etc/sysvinit-sesame
Log:
Add a description to the init script metadata, to satisfy chkconfig
Modified: mgmt/trunk/sesame/cpp/etc/sysvinit-sesame
===================================================================
--- mgmt/trunk/sesame/cpp/etc/sysvinit-sesame 2008-12-08 21:13:14 UTC (rev 2952)
+++ mgmt/trunk/sesame/cpp/etc/sysvinit-sesame 2008-12-09 15:53:21 UTC (rev 2953)
@@ -1,6 +1,7 @@
#!/bin/sh
#
# chkconfig: 2345 80 30
+# description: A daemon that sends info about this system to a QMF broker
# sesame: Sesame daemon
# processname: sesame
# pidfile: /var/run/sesame.pid
16 years, 3 months
rhmessaging commits: r2952 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-12-08 16:13:14 -0500 (Mon, 08 Dec 2008)
New Revision: 2952
Modified:
mgmt/trunk/cumin/python/cumin/page.py
mgmt/trunk/cumin/python/cumin/page.strings
Log:
Add a link to add a management data source, from the opening display
Modified: mgmt/trunk/cumin/python/cumin/page.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.py 2008-12-08 20:21:01 UTC (rev 2951)
+++ mgmt/trunk/cumin/python/cumin/page.py 2008-12-08 21:13:14 UTC (rev 2952)
@@ -257,8 +257,10 @@
def render_title(self, session):
return "Overview"
- def render_content(self, session):
- pass
+ def render_add_qmf_source_href(self, session):
+ branch = session.branch()
+ self.page.main.brokers_add.show(branch)
+ return branch.marshal()
class AccountTab(ActionSet):
def render_title(self, session):
Modified: mgmt/trunk/cumin/python/cumin/page.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/page.strings 2008-12-08 20:21:01 UTC (rev 2951)
+++ mgmt/trunk/cumin/python/cumin/page.strings 2008-12-08 21:13:14 UTC (rev 2952)
@@ -184,6 +184,11 @@
<div class="TabbedModeSet mode">{mode}</div>
</div>
+[OverviewTab.html]
+<ul class="actions">
+ <li><a class="nav" href="{add_qmf_source_href}">Add Management Data Source</a></li>
+</ul>
+
[AccountTab.html]
<ul class="actions">
<a class="nav" href="{change_password_href}">Change Password</a>
16 years, 3 months
rhmessaging commits: r2951 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-08 15:21:01 -0500 (Mon, 08 Dec 2008)
New Revision: 2951
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
Adding sync method to local Pool class to allow background xml to be generated.
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-12-08 19:33:25 UTC (rev 2950)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-12-08 20:21:01 UTC (rev 2951)
@@ -1867,8 +1867,10 @@
for coll in Collector.select("pool='%s'" % id):
return Pool(coll)
get = classmethod(get)
-
+ def sync(self):
+ pass
+
class CuminPool(CuminClass):
def __init__(self, model):
super(CuminPool, self).__init__(model, "pool", Pool)
16 years, 3 months