rhmessaging commits: r1527 - in mgmt: cumin/python/wooly and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-12-21 16:41:26 -0500 (Fri, 21 Dec 2007)
New Revision: 1527
Added:
mgmt/cumin/python/wooly/tables.py
mgmt/cumin/python/wooly/tables.strings
Modified:
mgmt/cumin/python/cumin/__init__.py
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/cumin/python/cumin/widgets.py
mgmt/cumin/python/wooly/widgets.py
mgmt/notes/justin-todo.txt
Log:
Adds a SqlTable class that takes sql mappings, generates queries, and
maps the results …
[View More]to column renderers.
Uses this class to list client sessions.
Modified: mgmt/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2007-12-21 16:35:23 UTC (rev 1526)
+++ mgmt/cumin/python/cumin/__init__.py 2007-12-21 21:41:26 UTC (rev 1527)
@@ -7,7 +7,6 @@
from wooly.devel import DevelPage
from wooly.parameters import IntegerParameter
from mint import *
-from sqlobject.main import *
from time import sleep
from threading import Thread, Event
@@ -32,7 +31,7 @@
self.model = CuminModel()
self.broker_connect_thread = BrokerConnectThread(self.model)
- #self.broker_connect_thread.start()
+ self.broker_connect_thread.start()
self.cumin_page = CuminPage(self, "cumin.html")
self.set_default_page(self.cumin_page)
@@ -47,7 +46,6 @@
self.add_page(ExchangeChartPage(self, "exchange.png"))
self.add_page(ClientXmlPage(self, "client.xml"))
self.add_page(ClientChartPage(self, "client.png"))
- self.add_page(TestPage(self, "test.html"))
class CuminServer(WebServer):
def __init__(self, port=9090):
@@ -107,32 +105,3 @@
print "Connection succeeded"
except socket.error:
print "Connection failed"
-
-from wooly.widgets import SqlItemTable, ItemTableColumn
-from sqlobject import sqlhub
-
-class TestPage(Page):
- def __init__(self, app, name):
- super(TestPage, self).__init__(app, name)
-
- self.table = self.TestTable(app, "test")
- self.add_child(self.table)
-
- class TestTable(SqlItemTable):
- def __init__(self, app, name):
- super(TestPage.TestTable, self).__init__(app, name)
-
- col = ItemTableColumn(app, "a")
- self.add_column(col)
-
- col = ItemTableColumn(app, "b")
- self.add_column(col)
-
- col = ItemTableColumn(app, "c")
- self.add_column(col)
-
- def get_connection(self, session):
- return sqlhub.getConnection().getConnection()
-
- def get_sql(self, session, object):
- return "select id, name, durable from queue"
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-12-21 16:35:23 UTC (rev 1526)
+++ mgmt/cumin/python/cumin/client.py 2007-12-21 21:41:26 UTC (rev 1527)
@@ -193,34 +193,53 @@
return "client.png?id=%i;s=framesToClient;s=bytesToClient" \
% client.id
-class ClientSessionSet(ItemSet):
+class ClientSessionSet(CuminTable):
+ def __init__(self, app, name):
+ super(ClientSessionSet, self).__init__(app, name)
+
+ self.table_sql = "session as s"
+ self.where_sql = "where s.client_id = %(id)r"
+
+ self.add_sql_join("session_stats as c", "c.id", "s.stats_curr_id")
+ self.add_sql_join("session_stats as p", "p.id", "s.stats_curr_id")
+
+ self.add_sql_column("name", "s.name")
+ self.add_sql_column("expires", "c.expire_time")
+ self.add_sql_column("status", "c.attached")
+
+ col = self.NameColumn(app, "name")
+ self.add_column(col)
+
+ col = self.ExpiresColumn(app, "expires")
+ self.add_column(col)
+
+ col = self.StatusColumn(app, "status")
+ self.add_column(col)
+
def get_title(self, session, client):
return "Sessions %s" % fmt_count(self.get_item_count(session, client))
+ def get_sql_values(self, session, client):
+ return {"id": client.id}
+
def get_item_count(self, session, client):
return client.sessions.count()
- def do_get_items(self, session, client):
- return client.sessions
+ class NameColumn(ItemTableColumn):
+ def get_title(self, session, object):
+ return "Name"
- def render_item_name(self, session, session_):
- return session_.name
+ class ExpiresColumn(ItemTableColumn):
+ def get_title(self, session, object):
+ return "Expires"
- def render_item_remaining_lifespan(self, session, session_):
- stat = self.app.model.session.get_stat("remainingLifespan")
- return fmt_duration(stat.value(session_))
+ def do_render(self, session, data):
+ return "<td>%s</td>" % fmt_datetime(data[self.name()])
- def render_item_frames_outstanding(self, session, session_):
- stat = self.app.model.session.get_stat("framesOutstanding")
- return stat.value(session_)
+ class StatusColumn(ItemTableColumn):
+ def get_title(self, session, object):
+ return "Status"
- def render_item_attached(self, session, session_):
- stat = self.app.model.session.get_stat("attached")
- return fmt_predicate(stat.value(session_))
-
- def render_item_status(self, session, session_):
- return fmt_ostatus(session_)
-
class ClientXmlPage(CuminXmlPage):
def __init__(self, app, name):
super(ClientXmlPage, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-12-21 16:35:23 UTC (rev 1526)
+++ mgmt/cumin/python/cumin/client.strings 2007-12-21 21:41:26 UTC (rev 1527)
@@ -154,6 +154,8 @@
</script>
[ClientSessionSet.html]
+<div class="rfloat">{page}</div>
+
<div class="sactions">
<h2>Act on Selected Sessions:</h2>
<button>Solicit Ack</button>
@@ -163,24 +165,18 @@
</div>
<table class="mobjects">
- <tr>
- <th><input type="checkbox"/></th>
- <th>Name</th>
- <th class="ralign">Remaining Lifespan</th>
- <th class="ralign">Frames Outstanding</th>
- <th>Attached?</th>
- <th>Status</th>
- </tr>
+ <thead>
+ <tr>
+ <th><input type="checkbox"/></th>
+ {headers}
+ </tr>
+ </thead>
- {items}
+ <tbody>{items}</tbody>
</table>
[ClientSessionSet.item_html]
<tr>
<td><input type="checkbox"/></td>
- <td>{item_name}</td>
- <td class="ralign">{item_remaining_lifespan}</td>
- <td class="ralign">{item_frames_outstanding}</td>
- <td>{item_attached}</td>
- <td>{item_status}</td>
+ {cells}
</tr>
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-12-21 16:35:23 UTC (rev 1526)
+++ mgmt/cumin/python/cumin/widgets.py 2007-12-21 21:41:26 UTC (rev 1527)
@@ -1,8 +1,10 @@
from math import ceil
+from sqlobject import sqlhub
from sqlobject.sresults import SelectResults
from wooly import *
from wooly.widgets import *
from wooly.forms import *
+from wooly.tables import *
from mint import *
from parameters import *
@@ -410,6 +412,25 @@
return items
+class CuminTable(SqlTable):
+ def __init__(self, app, name):
+ super(CuminTable, self).__init__(app, name)
+
+ self.paginator = Paginator(app, "page")
+ self.add_child(self.paginator)
+
+ def get_connection(self, session):
+ return sqlhub.getConnection().getConnection()
+
+ def do_process(self, session, object):
+ super(CuminTable, self).do_process(session, object)
+
+ self.paginator.set_count(session, self.get_item_count(session, object))
+
+ def get_limit_sql(self, session):
+ start, end = self.paginator.get_bounds(session)
+ return "limit %i offset %i" % (end, start)
+
class PaginatedItemSet(ItemSet):
def __init__(self, app, name):
super(PaginatedItemSet, self).__init__(app, name)
@@ -475,4 +496,3 @@
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")
-
Added: mgmt/cumin/python/wooly/tables.py
===================================================================
--- mgmt/cumin/python/wooly/tables.py (rev 0)
+++ mgmt/cumin/python/wooly/tables.py 2007-12-21 21:41:26 UTC (rev 1527)
@@ -0,0 +1,261 @@
+from wooly import *
+from widgets import *
+from parameters import *
+
+strings = StringCatalog(__file__)
+
+class ItemTable(ItemSet):
+ def __init__(self, app, name):
+ super(ItemTable, self).__init__(app, name)
+
+ self.header_html = Template(self, "header_html")
+ self.cell_tmpl = Template(self, "cell_html")
+
+ self.columns = list()
+
+ self.scolumn = Parameter(app, "col")
+ self.add_parameter(self.scolumn)
+
+ self.reversed = BooleanParameter(app, "rev")
+ self.reversed.set_default(False)
+ self.add_parameter(self.reversed)
+
+ def add_column(self, column):
+ self.columns.append(column)
+ self.add_child(column)
+
+ if self.scolumn.default is None:
+ self.scolumn.default = column.name()
+
+ def get_selected_column(self, session):
+ name = self.scolumn.get(session)
+ for column in self.columns:
+ if column.name() == name:
+ return column
+
+ def is_reversed(self, session):
+ return self.reversed.get(session)
+
+ def get_items(self, session, object):
+ """Gets the rows"""
+
+ return None
+
+ def render_headers(self, session, object):
+ writer = Writer()
+
+ for column in self.columns:
+ self.header_html.render(session, (column, object), writer)
+
+ return writer.to_string()
+
+ #def render_header_class(self, session, column):
+ # return " ".join(column.get_classes(session))
+
+ def render_header_href(self, session, args):
+ column, object = args
+ branch = session.branch()
+
+ if column.name() == self.scolumn.get(session):
+ self.reversed.set(branch, not self.reversed.get(session))
+
+ self.scolumn.set(branch, column.name())
+
+ return branch.marshal()
+
+ def render_header_content(self, session, args):
+ column, object = args
+ return column.get_title(session, object)
+
+ def render_cells(self, session, data):
+ data_map = dict()
+
+ for col, datum in zip(self.columns, data):
+ data_map[col.name()] = datum
+
+ writer = Writer()
+
+ for col in self.columns:
+ writer.write(col.render(session, data_map))
+
+ return writer.to_string()
+
+ def render_none(self, session, object):
+ """For producing a message when the table is empty"""
+
+ return None
+
+class ItemTableColumn(Widget):
+ def __init__(self, app, name):
+ super(ItemTableColumn, self).__init__(app, name)
+
+ def do_render(self, session, data):
+ return "<td>%s</td>" % str(data[self.name()])
+
+class SqlTable(ItemTable):
+ def __init__(self, app, name):
+ super(SqlTable, self).__init__(app, name)
+
+ self.table_sql = None
+ self.where_sql = None
+ self.sql_joins = list()
+ self.sql_columns = list()
+
+ def add_sql_join(self, table_sql, column_sql, fk_column_sql):
+ join = self.SqlJoin(self, table_sql, column_sql, fk_column_sql)
+ self.sql_joins.append(join)
+
+ def add_sql_column(self, name, sql):
+ col = self.SqlColumn(self, name, sql)
+ self.sql_columns.append(col)
+
+ def get_sql_column(self, name):
+ for col in self.sql_columns:
+ if col.name == name:
+ return col
+
+ def get_select_sql(self, session):
+ if not self.sql_columns:
+ raise Exception()
+
+ cols = ", ".join([col.get_sql(session) for col in self.sql_columns])
+ sql = "select %s" % cols
+
+ return sql
+
+ def get_from_sql(self, session):
+ if not self.table_sql:
+ raise Exception()
+
+ elems = list()
+
+ elems.append("from %s" % self.table_sql)
+
+ for join in self.sql_joins:
+ elems.append(join.get_sql(session))
+
+ return "\n".join(elems)
+
+ def get_where_sql(self, session):
+ return self.where_sql
+
+ def get_orderby_sql(self, session):
+ scol = self.get_selected_column(session)
+ sqlcol = self.get_sql_column(scol.name())
+
+ if sqlcol:
+ column_sql = sqlcol.get_sql(session)
+ dir = self.is_reversed(session) and "desc" or "asc"
+ sql = "order by %s %s" % (column_sql, dir)
+
+ return sql
+
+ def get_limit_sql(self, session):
+ return None
+
+ def get_sql(self, session):
+ elems = (self.get_select_sql(session),
+ self.get_from_sql(session),
+ self.get_where_sql(session),
+ self.get_orderby_sql(session),
+ self.get_limit_sql(session))
+
+ writer = Writer()
+
+ for elem in elems:
+ if elem:
+ writer.write(elem)
+ writer.write("\n")
+
+ sql = writer.to_string()
+
+ #print sql
+
+ return sql
+
+ def get_sql_values(self, session, object):
+ return None
+
+ def get_connection(self, session):
+ pass
+
+ def get_items(self, session, object):
+ conn = self.get_connection(session)
+
+ if conn:
+ cursor = conn.cursor()
+ sql = self.get_sql(session)
+ sql_values = self.get_sql_values(session, object)
+
+ cursor.execute(sql, sql_values)
+
+ return cursor
+
+ def do_render(self, session, object):
+ cursor = self.get_items(session, object)
+
+ if cursor:
+ html = super(ItemSet, self).do_render(session, cursor)
+ else:
+ html = self.render_none(session, object)
+
+ return html
+
+ def render_items(self, session, cursor):
+ writer = Writer()
+
+ for row in cursor:
+ self.item_tmpl.render(session, row, writer)
+
+ return writer.to_string()
+
+ def render_cells(self, session, data):
+ data_map = dict()
+
+ for col, datum in zip(self.sql_columns, data):
+ data_map[col.name] = datum
+
+ writer = Writer()
+
+ for col in self.columns:
+ writer.write(col.render(session, data_map))
+
+ return writer.to_string()
+
+ class SqlColumn(object):
+ def __init__(self, table, name, sql):
+ self.table = table
+ self.name = name
+ self.sql = sql
+
+ def get_sql(self, session):
+ return self.sql
+
+ class SqlJoin(object):
+ def __init__(self, table,
+ table_sql=None, column_sql=None, fk_column_sql=None):
+ self.table = table
+ self.table_sql = table_sql
+ self.column_sql = column_sql
+ self.fk_column_sql = fk_column_sql
+ self.type_sql = "left outer join"
+
+ def get_table_sql(self, session):
+ return self.table_sql
+
+ def get_column_sql(self, session):
+ return self.column_sql
+
+ def get_fk_column_sql(self, session):
+ return self.fk_column_sql
+
+ def get_type_sql(self, session):
+ return self.type_sql
+
+ def get_sql(self, session):
+ elems = (self.get_type_sql(session),
+ self.get_table_sql(session),
+ "on", self.get_column_sql(session),
+ "=", self.get_fk_column_sql(session))
+
+ return " ".join(elems)
Added: mgmt/cumin/python/wooly/tables.strings
===================================================================
--- mgmt/cumin/python/wooly/tables.strings (rev 0)
+++ mgmt/cumin/python/wooly/tables.strings 2007-12-21 21:41:26 UTC (rev 1527)
@@ -0,0 +1,13 @@
+[ItemTable.html]
+<table>
+ <thead>{headers}</thead>
+ <tbody>{items}</tbody>
+</table>
+
+[ItemTable.header_html]
+<th class="{header_class}"><a href="{header_href}">{header_content}</a></th>
+
+[ItemTable.item_html]
+<tr>
+ {cells}
+</tr>
Modified: mgmt/cumin/python/wooly/widgets.py
===================================================================
--- mgmt/cumin/python/wooly/widgets.py 2007-12-21 16:35:23 UTC (rev 1526)
+++ mgmt/cumin/python/wooly/widgets.py 2007-12-21 21:41:26 UTC (rev 1527)
@@ -142,14 +142,6 @@
def do_get_items(self, session, object):
return ()
- def do_render(self, session, object):
- if self.get_item_count(session, object):
- html = super(ItemSet, self).do_render(session, object)
- else:
- html = self.render_none(session, object)
-
- return html
-
def render_items(self, session, object):
items = self.get_items(session, object)
writer = Writer()
@@ -182,83 +174,3 @@
self.item_tmpl.render(session, child, writer)
return writer.to_string()
-
-class ItemTable(ItemSet):
- def __init__(self, app, name):
- super(ItemTable, self).__init__(app, name)
-
- self.cell_tmpl = Template(self, "cell_html")
-
- self.columns = list()
-
- def add_column(self, column):
- self.columns.append(column)
- self.add_child(column)
-
- # Here "items" are rows
- def get_items(self, session, object):
- return None
-
- def render_cells(self, session, item):
- writer = Writer()
-
- for col, datum in zip(self.columns, item):
- writer.write(col.render(session, datum))
-
- return writer.to_string()
-
- def render_none(self, session, object):
- """For producing a message when the table is empty"""
-
- return None
-
-class ItemTableColumn(Widget):
- def __init__(self, app, name):
- super(ItemTableColumn, self).__init__(app, name)
-
- def do_render(self, session, object):
- return "<td>%s</td>" % str(object)
-
-class SqlItemTable(ItemTable):
- def __init__(self, app, name):
- super(SqlItemTable, self).__init__(app, name)
-
- def get_connection(self, session):
- pass
-
- def get_sql(self, session, object):
- pass
-
- def get_items(self, session, object):
- conn = self.get_connection(session)
-
- if conn:
- cursor = conn.cursor()
- sql = self.get_sql(session, object)
-
- cursor.execute(sql)
-
- return cursor
-
- def do_render(self, session, object):
- cursor = self.get_items(session, object)
-
- if cursor:
- html = super(ItemSet, self).do_render(session, cursor)
- else:
- html = "XXX none"
-
- return html
-
- def render_items(self, session, cursor):
- writer = Writer()
-
- while True:
- row = cursor.fetchone()
-
- if not row:
- break
-
- self.item_tmpl.render(session, row, writer)
-
- return writer.to_string()
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-12-21 16:35:23 UTC (rev 1526)
+++ mgmt/notes/justin-todo.txt 2007-12-21 21:41:26 UTC (rev 1527)
@@ -38,6 +38,9 @@
Deferred
+ * Directly set attr.default for static defaults; eliminate
+ attr.set_default
+
* Add sort direction icon
* Deal with large numbers of pages in paginators
[View Less]
17 years, 3 months
rhmessaging commits: r1525 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-12-20 09:34:26 -0500 (Thu, 20 Dec 2007)
New Revision: 1525
Modified:
mgmt/cumin/python/cumin/__init__.py
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/wooly/widgets.py
mgmt/cumin/python/wooly/widgets.strings
Log:
Adds a bulk broker unregister form.
Adds a test.html page for purposes of developing the new query-backed
table views.
Modified: mgmt/cumin/python/cumin/…
[View More]__init__.py
===================================================================
--- mgmt/cumin/python/cumin/__init__.py 2007-12-20 14:28:50 UTC (rev 1524)
+++ mgmt/cumin/python/cumin/__init__.py 2007-12-20 14:34:26 UTC (rev 1525)
@@ -32,7 +32,7 @@
self.model = CuminModel()
self.broker_connect_thread = BrokerConnectThread(self.model)
- self.broker_connect_thread.start()
+ #self.broker_connect_thread.start()
self.cumin_page = CuminPage(self, "cumin.html")
self.set_default_page(self.cumin_page)
@@ -47,6 +47,7 @@
self.add_page(ExchangeChartPage(self, "exchange.png"))
self.add_page(ClientXmlPage(self, "client.xml"))
self.add_page(ClientChartPage(self, "client.png"))
+ self.add_page(TestPage(self, "test.html"))
class CuminServer(WebServer):
def __init__(self, port=9090):
@@ -106,3 +107,32 @@
print "Connection succeeded"
except socket.error:
print "Connection failed"
+
+from wooly.widgets import SqlItemTable, ItemTableColumn
+from sqlobject import sqlhub
+
+class TestPage(Page):
+ def __init__(self, app, name):
+ super(TestPage, self).__init__(app, name)
+
+ self.table = self.TestTable(app, "test")
+ self.add_child(self.table)
+
+ class TestTable(SqlItemTable):
+ def __init__(self, app, name):
+ super(TestPage.TestTable, self).__init__(app, name)
+
+ col = ItemTableColumn(app, "a")
+ self.add_column(col)
+
+ col = ItemTableColumn(app, "b")
+ self.add_column(col)
+
+ col = ItemTableColumn(app, "c")
+ self.add_column(col)
+
+ def get_connection(self, session):
+ return sqlhub.getConnection().getConnection()
+
+ def get_sql(self, session, object):
+ return "select id, name, durable from queue"
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2007-12-20 14:28:50 UTC (rev 1524)
+++ mgmt/cumin/python/cumin/broker.py 2007-12-20 14:34:26 UTC (rev 1525)
@@ -58,24 +58,23 @@
brokers = self.brokers.get(session)
action = self.action.get(session)
- if action == "shutdown":
- for broker in brokers:
- print "Shutting down broker", broker
- elif action == "loadbalance":
- for broker in brokers:
- print "Load balancing broker", broker
+ if action == "remove":
+ branch = session.branch()
+ frame = self.page().show_broker_set_remove(branch)
+ frame.set_brokers(branch, brokers)
+ self.page().set_redirect_url(session, branch.marshal())
+ else:
+ group = self.groups.get(session)
- group = self.groups.get(session)
+ if group:
+ for broker in brokers:
+ try:
+ broker.addBrokerGroup(group)
+ except IntegrityError:
+ pass
- if group:
- for broker in brokers:
- try:
- broker.addBrokerGroup(group)
- except IntegrityError:
- pass
+ self.page().set_redirect_url(session, session.marshal())
- self.page().set_redirect_url(session, session.marshal())
-
def render_action_param_name(self, session, broker):
return self.action.path()
@@ -718,16 +717,46 @@
def render_cancel_content(self, session, broker):
return "No, Cancel"
-class BrokerSetRemove(CuminActionSetForm):
+class BrokerSetRemove(CuminActionSetForm, Frame):
+ def __init__(self, app, name):
+ super(BrokerSetRemove, self).__init__(app, name)
+
+ self.param = BrokerParameter(app, "param")
+ self.add_parameter(self.param)
+ self.add_form_parameter(self.param)
+
+ self.brokers = ListParameter(app, "id", self.param)
+ self.add_parameter(self.brokers)
+ self.add_form_parameter(self.brokers)
+
def get_title(self, session, model):
return "Unregister Brokers"
+ def set_brokers(self, session, brokers):
+ self.brokers.set(session, brokers)
+
def process_cancel(self, session, model):
branch = session.branch()
self.page().show_view(branch)
self.page().set_redirect_url(session, branch.marshal())
def process_submit(self, session, model):
- branch = session.branch()
- self.page().show_view(branch)
- self.page().set_redirect_url(session, branch.marshal())
+ brokers = self.brokers.get(session)
+
+ print "submit with brokers", brokers
+
+ for broker in brokers:
+ try:
+ print "destroying broker reg", broker
+ broker.destroySelf()
+ except Exception, e:
+ # In an extra ui step, note any errors that arose
+ print e
+
+ self.process_cancel(session, model)
+
+ def get_items(self, session, model):
+ return self.brokers.get(session)
+
+ def render_item_content(self, session, broker):
+ return "Unregister Broker '%s'" % broker.name
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2007-12-20 14:28:50 UTC (rev 1524)
+++ mgmt/cumin/python/cumin/broker.strings 2007-12-20 14:34:26 UTC (rev 1525)
@@ -9,7 +9,7 @@
<select name="{action_param_name}" onchange="submit()">
<option value="">Choose Action...</option>
- <option value="unregister">Unregister</option>
+ <option value="remove">Unregister</option>
</select>
<h2>Add to Group:</h2>
@@ -19,7 +19,7 @@
<table class="mobjects">
<tr>
- <th><input type="checkbox"/></th>
+ <th></th>
<th>Name</th>
<!--
<th>Profile</th>
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-12-20 14:28:50 UTC (rev 1524)
+++ mgmt/cumin/python/cumin/page.py 2007-12-20 14:34:26 UTC (rev 1525)
@@ -35,6 +35,9 @@
self.broker_add = BrokerAdd(app, "brokeradd")
self.add_mode(self.broker_add)
+ self.broker_set_remove = BrokerSetRemove(app, "brokersrem")
+ self.add_mode(self.broker_set_remove)
+
self.group = BrokerGroupFrame(app, "group")
self.add_mode(self.group)
@@ -90,6 +93,10 @@
frame = self.show_mode(session, self.broker_add)
return self.set_current_frame(session, frame)
+ def show_broker_set_remove(self, session):
+ frame = self.show_mode(session, self.broker_set_remove)
+ return self.set_current_frame(session, frame)
+
def show_broker_group(self, session, group):
frame = self.show_mode(session, self.group)
frame.set_object(session, group)
Modified: mgmt/cumin/python/wooly/widgets.py
===================================================================
--- mgmt/cumin/python/wooly/widgets.py 2007-12-20 14:28:50 UTC (rev 1524)
+++ mgmt/cumin/python/wooly/widgets.py 2007-12-20 14:34:26 UTC (rev 1525)
@@ -187,7 +187,6 @@
def __init__(self, app, name):
super(ItemTable, self).__init__(app, name)
- self.heading_tmpl = Template(self, "heading_html")
self.cell_tmpl = Template(self, "cell_html")
self.columns = list()
@@ -196,24 +195,15 @@
self.columns.append(column)
self.add_child(column)
+ # Here "items" are rows
def get_items(self, session, object):
return None
- def render_headings(self, session, object):
- writer = Writer()
-
- for col in self.columns:
- if col.visible.get(session):
- col.render_heading(session, object, writer)
-
- return writer.to_string()
-
def render_cells(self, session, item):
writer = Writer()
- for col in self.columns:
- if col.visible.get(session):
- col.render_cell(session, item, writer)
+ for col, datum in zip(self.columns, item):
+ writer.write(col.render(session, datum))
return writer.to_string()
@@ -226,11 +216,49 @@
def __init__(self, app, name):
super(ItemTableColumn, self).__init__(app, name)
- self.visible = Attribute(app, "visible")
- self.visible.set_default(True)
- self.add_attribute(self.visible)
+ def do_render(self, session, object):
+ return "<td>%s</td>" % str(object)
- def render_cell_content(self, session, item):
+class SqlItemTable(ItemTable):
+ def __init__(self, app, name):
+ super(SqlItemTable, self).__init__(app, name)
+
+ def get_connection(self, session):
pass
-
+ def get_sql(self, session, object):
+ pass
+
+ def get_items(self, session, object):
+ conn = self.get_connection(session)
+
+ if conn:
+ cursor = conn.cursor()
+ sql = self.get_sql(session, object)
+
+ cursor.execute(sql)
+
+ return cursor
+
+ def do_render(self, session, object):
+ cursor = self.get_items(session, object)
+
+ if cursor:
+ html = super(ItemSet, self).do_render(session, cursor)
+ else:
+ html = "XXX none"
+
+ return html
+
+ def render_items(self, session, cursor):
+ writer = Writer()
+
+ while True:
+ row = cursor.fetchone()
+
+ if not row:
+ break
+
+ self.item_tmpl.render(session, row, writer)
+
+ return writer.to_string()
Modified: mgmt/cumin/python/wooly/widgets.strings
===================================================================
--- mgmt/cumin/python/wooly/widgets.strings 2007-12-20 14:28:50 UTC (rev 1524)
+++ mgmt/cumin/python/wooly/widgets.strings 2007-12-20 14:34:26 UTC (rev 1525)
@@ -75,20 +75,10 @@
[ItemTable.html]
<table>
- <tr>
- {headings}
- </tr>
-
{items}
</table>
-[ItemTable.heading_html]
-<th>{heading_content}</th>
-
[ItemTable.item_html]
<tr>
{cells}
</tr>
-
-[ItemTable.cell_html]
-<td>{cell_content}</td>
[View Less]
17 years, 3 months
rhmessaging commits: r1524 - mgmt/notes.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-12-20 09:28:50 -0500 (Thu, 20 Dec 2007)
New Revision: 1524
Modified:
mgmt/notes/justin-todo.txt
Log:
New todo items.
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-12-19 20:36:48 UTC (rev 1523)
+++ mgmt/notes/justin-todo.txt 2007-12-20 14:28:50 UTC (rev 1524)
@@ -38,6 +38,17 @@
Deferred
+ * Add sort direction icon
+
+ * Deal with large numbers of pages in …
[View More]paginators
+
+ * Change first-click sort to desc for number fields
+
+ * Rename BrokerAdd on CuminPage to BrokerSetAdd
+
+ * So that list params can embed an item param, find a way to avoid
+ the need to attach params to widgets in every instance
+
* Consider making CuminForm (or Form) also have Frame behavior
* Sortify broker groups
[View Less]
17 years, 3 months
rhmessaging commits: r1523 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-12-19 15:36:48 -0500 (Wed, 19 Dec 2007)
New Revision: 1523
Modified:
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/nlfh.cpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/wrfc.cpp
Log:
Fix for BZ 425211. Large files exposed incorrect initialization of read manger counters.
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-12-…
[View More]19 14:32:22 UTC (rev 1522)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-12-19 20:36:48 UTC (rev 1523)
@@ -150,8 +150,8 @@
if (_rcvdat._full)
throw jexception(jerrno::JERR_JCNTL_RECOVERJFULL, "jcntl", "recover_complete");
- // Debug info; may be useful to print with a flag
- // std::cout << _rcvdat.to_string(_jid) << std::endl;
+ // Debug info; should be sent to log file
+ // std::cout << _rcvdat.to_string(_jid) << std::endl << std::flush;
if (_datafh)
{
@@ -519,14 +519,14 @@
rec_hdr h;
if (!jfile_cycle(fid, ifsp, lowi, rd, true))
return false;
- std::streampos read_pos = ifsp->tellg();
+ std::streampos file_pos = ifsp->tellg();
ifsp->read((char*)&h, sizeof(rec_hdr));
switch(h._magic)
{
case RHM_JDAT_ENQ_MAGIC:
{
enq_rec er;
- if (!decode(er, fid, ifsp, cum_size_read, h, lowi, rd, read_pos))
+ if (!decode(er, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
return false;
if (!er.is_transient()) // Ignore transient msgs
{
@@ -547,7 +547,7 @@
case RHM_JDAT_DEQ_MAGIC:
{
deq_rec dr;
- if (!decode(dr, fid, ifsp, cum_size_read, h, lowi, rd, read_pos))
+ if (!decode(dr, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
return false;
if (dr.xid_size())
{
@@ -580,7 +580,7 @@
case RHM_JDAT_TXA_MAGIC:
{
txn_rec ar;
- if (!decode(ar, fid, ifsp, cum_size_read, h, lowi, rd, read_pos))
+ if (!decode(ar, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
return false;
// Delete this txn from tmap, unlock any locked records in emap
ar.get_xid(&xidp);
@@ -607,7 +607,7 @@
case RHM_JDAT_TXC_MAGIC:
{
txn_rec cr;
- if (!decode(cr, fid, ifsp, cum_size_read, h, lowi, rd, read_pos))
+ if (!decode(cr, fid, ifsp, cum_size_read, h, lowi, rd, file_pos))
return false;
// Delete this txn from tmap, process records into emap
cr.get_xid(&xidp);
@@ -638,27 +638,21 @@
rd._eo = ifsp->tellg();
return false;
default:
- // Is this the last file, if so, stop as this is the overwrite boundary.
- if (fid == (rd._ffid ? rd._ffid - 1 : _num_jfiles - 1))
- {
- rd._lfid = fid;
- rd._eo = read_pos;
- return false;
- }
- std::ostringstream oss;
- oss << std::hex << std::setfill('0') << "Magic=0x" << std::setw(8) << h._magic;
- oss << " fid=" << fid << " foffs=0x" << std::setw(8) << read_pos;
- throw jexception(jerrno::JERR_JCNTL_UNKNOWNMAGIC, oss.str(), "jcntl",
- "rcvr_get_next_record");
+ // Stop as this is the overwrite boundary.
+ rd._lfid = fid;
+ rd._eo = file_pos;
+ return false;
}
return true;
}
const bool
jcntl::decode(jrec& rec, u_int16_t& fid, std::ifstream* ifsp, size_t& cum_size_read, rec_hdr& h,
- bool& lowi, rcvdat& rd, std::streampos& rec_offset)
+ bool& lowi, rcvdat& rd, std::streampos& file_offs)
{
- if (!check_owi(fid, h, lowi, rd, rec_offset))
+ u_int16_t start_fid = fid;
+ std::streampos start_file_offs = file_offs;
+ if (!check_owi(fid, h, lowi, rd, file_offs))
return false;
bool done = false;
while (!done)
@@ -668,9 +662,9 @@
{
if (e.err_code() != jerrno::JERR_JREC_BADRECTAIL ||
fid != (rd._ffid ? rd._ffid - 1 : _num_jfiles - 1)) throw;
- check_journal_alignment(fid, rec_offset);
- rd._lfid = fid;
- rd._eo = rec_offset;
+ check_journal_alignment(start_fid, start_file_offs);
+ rd._lfid = start_fid;
+ rd._eo = start_file_offs;
return false;
}
if (!jfile_cycle(fid, ifsp, lowi, rd, false))
@@ -728,22 +722,22 @@
}
const bool
-jcntl::check_owi(const u_int16_t fid, rec_hdr& h, bool& lowi, rcvdat& rd, std::streampos& read_pos)
+jcntl::check_owi(const u_int16_t fid, rec_hdr& h, bool& lowi, rcvdat& rd, std::streampos& file_pos)
{
if (rd._ffid ? h.get_owi() == lowi : h.get_owi() != lowi) // Overwrite indicator changed
{
u_int16_t expected_fid = rd._ffid ? rd._ffid - 1 : _num_jfiles - 1;
if (fid == expected_fid)
{
- check_journal_alignment(fid, read_pos);
+ check_journal_alignment(fid, file_pos);
rd._lfid = fid;
- rd._eo = read_pos;
+ rd._eo = file_pos;
return false;
}
std::ostringstream oss;
oss << std::hex << std::setfill('0') << "Magic=0x" << std::setw(8) << h._magic;
oss << " fid=0x" << std::setw(4) << fid << " rid=0x" << std::setw(8) << h._rid;
- oss << " foffs=0x" << std::setw(8) << read_pos;
+ oss << " foffs=0x" << std::setw(8) << file_pos;
oss << " expected_fid=0x" << std::setw(4) << expected_fid;
throw jexception(jerrno::JERR_JCNTL_OWIMISMATCH, oss.str(), "jcntl",
"check_owi");
@@ -755,14 +749,14 @@
void
-jcntl::check_journal_alignment(const u_int16_t fid, std::streampos& rec_offset)
+jcntl::check_journal_alignment(const u_int16_t fid, std::streampos& file_pos)
{
- unsigned sblk_offs = rec_offset % (JRNL_DBLK_SIZE * JRNL_SBLK_SIZE);
+ unsigned sblk_offs = file_pos % (JRNL_DBLK_SIZE * JRNL_SBLK_SIZE);
if (sblk_offs)
{
// TODO: Connect the following with logger:
std::cout << std::hex << "INFO: Bad record alignment found at fid=0x" << fid <<
- " offs=0x" << rec_offset << " (likely journal overwrite boundary); " <<
+ " offs=0x" << file_pos << " (likely journal overwrite boundary); " <<
(JRNL_SBLK_SIZE - (sblk_offs/JRNL_DBLK_SIZE)) <<
" filler record(s) required." << std::endl;
const u_int32_t xmagic = RHM_JDAT_EMPTY_MAGIC;
@@ -773,7 +767,7 @@
std::ios_base::in | std::ios_base::out | std::ios_base::binary);
if (!ofsp.good())
throw jexception(jerrno::JERR__FILEIO, oss.str(), "jcntl", "check_journal_alignment");
- ofsp.seekp(rec_offset);
+ ofsp.seekp(file_pos);
void* buff = ::malloc(JRNL_DBLK_SIZE);
assert(buff != NULL);
::memcpy(buff, (void*)&xmagic, sizeof(xmagic));
@@ -782,13 +776,13 @@
// clear should inspection of the file be required.
::memset((char*)buff + sizeof(xmagic), RHM_CLEAN_CHAR, JRNL_DBLK_SIZE - sizeof(xmagic));
- while (rec_offset % (JRNL_DBLK_SIZE * JRNL_SBLK_SIZE))
+ while (file_pos % (JRNL_DBLK_SIZE * JRNL_SBLK_SIZE))
{
ofsp.write((const char*)buff, JRNL_DBLK_SIZE);
assert(!ofsp.fail());
// TODO: Connect the following with logger:
- std::cout << "INFO: * Wrote filler record at offs=0x" << rec_offset << std::endl;
- rec_offset = ofsp.tellp();
+ std::cout << "INFO: * Wrote filler record at offs=0x" << file_pos << std::endl;
+ file_pos = ofsp.tellp();
}
ofsp.close();
::free(buff);
Modified: store/trunk/cpp/lib/jrnl/nlfh.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/nlfh.cpp 2007-12-19 14:32:22 UTC (rev 1522)
+++ store/trunk/cpp/lib/jrnl/nlfh.cpp 2007-12-19 20:36:48 UTC (rev 1523)
@@ -108,15 +108,19 @@
if (::stat(_fname.c_str(), &s))
{
#endif
- if (ro)
+ if (ro) // Recovery initialization: set counters only
{
if (!ro->_empty)
{
+ // For first file only, set read counters to ahead of file header
if (ro->_ffid == _fid)
{
_rd_subm_cnt_dblks = JRNL_SBLK_SIZE;
_rd_cmpl_cnt_dblks = JRNL_SBLK_SIZE;
}
+
+ // For last file only, set write counters to end of last record (the
+ // continuation point); for all others, set to eof.
if (ro->_lfid == _fid)
{
_wr_subm_cnt_dblks = ro->_eo/JRNL_DBLK_SIZE;
@@ -127,19 +131,20 @@
_wr_subm_cnt_dblks = _ffull_dblks;
_wr_cmpl_cnt_dblks = _ffull_dblks;
}
+ // Set the number of enqueued records for this file.
_rec_enqcnt = ro->_enq_cnt_list[_fid];
}
}
- else
+ else // Normal initialization: create empty journal files
{
const size_t sblksize = JRNL_DBLK_SIZE * JRNL_SBLK_SIZE;
const size_t writesize = sblksize * JRNL_WMGR_PAGE_SIZE;
// NOTE: The journal file size is always one sblock bigger than the specified journal
- // file size, which is the data content size. The extra
- // block is for the journal file header which precedes all data on each file and is
- // exactly one softblock in size.
+ // file size, which is the data content size. The extra block is for the journal file
+ // header which precedes all data on each file and is exactly one sblock in size.
u_int32_t nsblks = jfsize_sblks + 1;
+
void* nullbuf = NULL;
if (::posix_memalign(&nullbuf, sblksize, writesize))
{
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2007-12-19 14:32:22 UTC (rev 1522)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2007-12-19 20:36:48 UTC (rev 1523)
@@ -66,7 +66,15 @@
_cb = rd_cb;
initialize();
if (fro)
- _pg_offset_dblks = (fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
+ {
+ u_int32_t fro_dblks = (fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
+ _pg_cntr = fro_dblks / (JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
+ u_int32_t tot_pg_offs_dblks = _pg_cntr * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
+ _pg_index = _pg_cntr % JRNL_RMGR_PAGES;
+ _pg_offset_dblks = fro_dblks - tot_pg_offs_dblks;
+ _rrfc.add_subm_cnt_dblks(tot_pg_offs_dblks);
+ _rrfc.add_cmpl_cnt_dblks(tot_pg_offs_dblks);
+ }
}
const iores
@@ -444,9 +452,16 @@
void
rmgr::recover_complete(size_t fro)
{
- _pg_index = 0;
- _pg_cntr = 0;
- _pg_offset_dblks = (fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
+ if (fro)
+ {
+ u_int32_t fro_dblks = (fro / JRNL_DBLK_SIZE) - JRNL_SBLK_SIZE;
+ _pg_cntr = fro_dblks / (JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE);
+ u_int32_t tot_pg_offs_dblks = _pg_cntr * JRNL_RMGR_PAGE_SIZE * JRNL_SBLK_SIZE;
+ _pg_index = _pg_cntr % JRNL_RMGR_PAGES;
+ _pg_offset_dblks = fro_dblks - tot_pg_offs_dblks;
+ _rrfc.add_subm_cnt_dblks(tot_pg_offs_dblks);
+ _rrfc.add_cmpl_cnt_dblks(tot_pg_offs_dblks);
+ }
}
void
Modified: store/trunk/cpp/lib/jrnl/wrfc.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wrfc.cpp 2007-12-19 14:32:22 UTC (rev 1522)
+++ store/trunk/cpp/lib/jrnl/wrfc.cpp 2007-12-19 20:36:48 UTC (rev 1523)
@@ -74,7 +74,7 @@
#ifdef DRHM_TESTVALS
_rid = u_int64_t(0xffeeddcc) << 32;
#else
- _rid = 0;
+ _rid = 0ULL;
#endif
_reset_ok = false;
}
[View Less]
17 years, 3 months
rhmessaging commits: r1522 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-12-19 09:32:22 -0500 (Wed, 19 Dec 2007)
New Revision: 1522
Modified:
store/trunk/cpp/lib/jrnl/txn_map.hpp
Log:
Some additional doxygen comments for txn_map class.
Modified: store/trunk/cpp/lib/jrnl/txn_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.hpp 2007-12-19 14:18:17 UTC (rev 1521)
+++ store/trunk/cpp/lib/jrnl/txn_map.hpp 2007-12-19 14:32:22 UTC (rev 1522)
@@ -61,7 +61,7 @@
u_int64_t …
[View More]_drid; ///< Dequeue record id for this operation
u_int16_t _fid; ///< File id, to be used when transferring to emap on commit
bool _enq_flag; ///< If true, enq op, otherwise deq op
- bool _aio_compl; ///< Initially false, set to true when AIO returns
+ bool _aio_compl; ///< Initially false, set to true when record AIO returns
txn_data_struct(const u_int64_t rid, const u_int64_t drid, const u_int16_t fid,
const bool enq_flag);
};
@@ -79,13 +79,17 @@
* for each operation included as part of the same transaction is mapped against the
* xid.
*
- * On transaction commit, then for each operation is handled as follows:
+ * The aio_compl flag is set true as each AIO write operation for the enqueue or dequeue
+ * returns. Checking that all of these flags are true for a given xid is the mechanism
+ * used to determine if the transaction is syncronized (through method is_txn_synced()).
*
+ * On transaction commit, then each operation is handled as follows:
+ *
* If an enqueue (_enq_flag is true), then the rid and fid are transferred to the enq_map.
* If a dequeue (_enq_flag is false), then the rid stored in the drid field is used to
* remove the corresponding record from the enq_map.
*
- * On transaction abort, then for each operation is handled as follows:
+ * On transaction abort, then each operation is handled as follows:
*
* If an enqueue (_enq_flag is true), then the data is simply discarded.
* If a dequeue (_enq_flag is false), then the lock for the corresponding enqueue in enq_map
[View Less]
17 years, 3 months
rhmessaging commits: r1521 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-12-19 09:18:17 -0500 (Wed, 19 Dec 2007)
New Revision: 1521
Modified:
store/trunk/cpp/lib/jrnl/enq_map.hpp
store/trunk/cpp/lib/jrnl/txn_map.hpp
Log:
Some doxygen comments for enq_map and txn_map classes.
Modified: store/trunk/cpp/lib/jrnl/enq_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_map.hpp 2007-12-19 08:50:22 UTC (rev 1520)
+++ store/trunk/cpp/lib/jrnl/enq_map.hpp 2007-12-19 14:18:17 UTC (rev …
[View More]1521)
@@ -54,7 +54,22 @@
/**
* \class enq_map
* \brief Class for storing the file id (fid) and a transaction locked flag for each enqueued
- * data block using the record id (rid) as a key.
+ * data block using the record id (rid) as a key. This is the primary mechanism for
+ * deterimining the enqueue low water mark: if an fid exists in this map, then there is
+ * at least one still-enqueued record in that file. (The transaction map must also be
+ * clear, however.)
+ *
+ * Map keying rids against fid and lock status. As records ar enqueued, they are added to this
+ * map, and as they are dequeued, they are removed. An enqueue is locked when a transactional
+ * dequeue is pending that has not been either committed or aborted.
+ * <pre>
+ * key data
+ *
+ * rid1 --- [ fid, txn_lock ]
+ * rid2 --- [ fid, txn_lock ]
+ * rid3 --- [ fid, txn_lock ]
+ * ...
+ * </pre>
*/
class enq_map
{
Modified: store/trunk/cpp/lib/jrnl/txn_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.hpp 2007-12-19 08:50:22 UTC (rev 1520)
+++ store/trunk/cpp/lib/jrnl/txn_map.hpp 2007-12-19 14:18:17 UTC (rev 1521)
@@ -50,6 +50,11 @@
namespace journal
{
+ /**
+ * \struct txn_data_struct
+ * \brief Struct encapsulating transaction data necessary for processing a transaction
+ * in the journal once it is closed with either a commit or abort.
+ */
struct txn_data_struct
{
u_int64_t _rid; ///< Record id for this operation
@@ -64,6 +69,37 @@
typedef std::vector<txn_data> txn_data_list;
typedef txn_data_list::iterator tdl_itr;
+ /**
+ * \class txn_map
+ * \brief Class for storing transaction data for each open (ie not committed or aborted)
+ * xid in the store. If aborted, records are discarded; if committed, they are
+ * transferred to the enqueue map.
+ *
+ * The data is encapsulated by struct txn_data_struct. A vector containing the information
+ * for each operation included as part of the same transaction is mapped against the
+ * xid.
+ *
+ * On transaction commit, then for each operation is handled as follows:
+ *
+ * If an enqueue (_enq_flag is true), then the rid and fid are transferred to the enq_map.
+ * If a dequeue (_enq_flag is false), then the rid stored in the drid field is used to
+ * remove the corresponding record from the enq_map.
+ *
+ * On transaction abort, then for each operation is handled as follows:
+ *
+ * If an enqueue (_enq_flag is true), then the data is simply discarded.
+ * If a dequeue (_enq_flag is false), then the lock for the corresponding enqueue in enq_map
+ * (if not a part of the same transaction) is removed, and the data discarded.
+ *
+ * <pre>
+ * key data
+ *
+ * xid1 --- vector< [ rid, drid, fid, enq_flag, aio_compl ] >
+ * xid2 --- vector< [ rid, drid, fid, enq_flag, aio_compl ] >
+ * xid3 --- vector< [ rid, drid, fid, enq_flag, aio_compl ] >
+ * ...
+ * </pre>
+ */
class txn_map
{
private:
[View Less]
17 years, 3 months
rhmessaging commits: r1520 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: gordonsim
Date: 2007-12-19 03:50:22 -0500 (Wed, 19 Dec 2007)
New Revision: 1520
Modified:
store/trunk/cpp/rhm.spec.in
Log:
Updated revision to reflect fixed rhmd.conf (option renamed from store to store-lib)
Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in 2007-12-19 08:48:49 UTC (rev 1519)
+++ store/trunk/cpp/rhm.spec.in 2007-12-19 08:50:22 UTC (rev 1520)
@@ -3,7 +3,7 @@
#
Name: …
[View More]rhm
Version: @VERSION@
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Red Hat extensions to the Qpid messaging system
Group: System Environment/Libraries
License: LGPL
[View Less]
17 years, 3 months
rhmessaging commits: r1519 - store/trunk/cpp/etc.
by rhmessaging-commits@lists.jboss.org
Author: gordonsim
Date: 2007-12-19 03:48:49 -0500 (Wed, 19 Dec 2007)
New Revision: 1519
Modified:
store/trunk/cpp/etc/rhmd.conf
Log:
Fixed conf file inline with recent change to option name.
Modified: store/trunk/cpp/etc/rhmd.conf
===================================================================
--- store/trunk/cpp/etc/rhmd.conf 2007-12-18 20:19:52 UTC (rev 1518)
+++ store/trunk/cpp/etc/rhmd.conf 2007-12-19 08:48:49 UTC (rev 1519)
@@ -1,2 +1,2 @@
# Configuration file for qpidd
-store=libbdbstore.so.0
+store-lib=libbdbstore.so.0
17 years, 3 months
rhmessaging commits: r1518 - mgmt/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-12-18 15:19:52 -0500 (Tue, 18 Dec 2007)
New Revision: 1518
Modified:
mgmt/mint/python/mint/__init__.py
mgmt/mint/python/mint/schema.py
mgmt/mint/python/mint/schema.sql
Log:
A schema update and a fix for a bug in broker registration.
Modified: mgmt/mint/python/mint/__init__.py
===================================================================
--- mgmt/mint/python/mint/__init__.py 2007-12-18 18:55:45 UTC (rev 1517)
+++ mgmt/mint/python/mint/__init__.py 2007-…
[View More]12-18 20:19:52 UTC (rev 1518)
@@ -89,12 +89,8 @@
if obj and obj.__class__ is Broker and obj.registration is None:
if obj.managedBroker:
host, port = obj.managedBroker.split(":")
-
port = int(port)
- if port == 5672:
- port = None
-
regs = BrokerRegistration.selectBy(host=host, port=port)
for reg in regs:
Modified: mgmt/mint/python/mint/schema.py
===================================================================
--- mgmt/mint/python/mint/schema.py 2007-12-18 18:55:45 UTC (rev 1517)
+++ mgmt/mint/python/mint/schema.py 2007-12-18 20:19:52 UTC (rev 1518)
@@ -313,7 +313,7 @@
recTime = TimestampCol(default=None)
session = ForeignKey('Session', cascade='null', default=None)
attached = BoolCol(default=None)
- remainingLifespan = IntCol(default=None)
+ expireTime = BigIntCol(default=None)
framesOutstanding = IntCol(default=None)
Session.sqlmeta.addJoin(SQLMultipleJoin('SessionStats', joinMethodName='stats'))
Modified: mgmt/mint/python/mint/schema.sql
===================================================================
--- mgmt/mint/python/mint/schema.sql 2007-12-18 18:55:45 UTC (rev 1517)
+++ mgmt/mint/python/mint/schema.sql 2007-12-18 20:19:52 UTC (rev 1518)
@@ -309,7 +309,7 @@
rec_time TIMESTAMP,
session_id INT,
attached BOOL,
- remaining_lifespan INT,
+ expire_time BIGINT,
frames_outstanding INT
);
[View Less]
17 years, 3 months
rhmessaging commits: r1517 - store/trunk/cpp.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2007-12-18 13:55:45 -0500 (Tue, 18 Dec 2007)
New Revision: 1517
Modified:
store/trunk/cpp/rhm.spec.in
Log:
update specfile with Kim's fixes
Modified: store/trunk/cpp/rhm.spec.in
===================================================================
--- store/trunk/cpp/rhm.spec.in 2007-12-18 18:17:28 UTC (rev 1516)
+++ store/trunk/cpp/rhm.spec.in 2007-12-18 18:55:45 UTC (rev 1517)
@@ -3,7 +3,7 @@
#
Name: rhm
Version: @VERSION@
-Release: 4%{?…
[View More]dist}
+Release: 5%{?dist}
Summary: Red Hat extensions to the Qpid messaging system
Group: System Environment/Libraries
License: LGPL
@@ -80,16 +80,31 @@
%changelog
+* Tue Dec 18 2007 Nuno Santos <nsantos(a)redhat.com> - 0.2-5
+- Include several fixes, mainly from Kim Van Der Riet (BZ 401071: Add journal
+ file geometry parameters to broker, 401091: Handle journal full condition in
+ broker, 401151: Journal RID not monotonically increasing in all cases,
+ 401191: Journal recovery fails when overwrite boundary coincides with
+ previous record, 403051: Failures in perftest fanout mode with async
+ persistence, 403201: Messages prematurely deleted by store, 413021: Journal
+ recovery fails when flush did not occur and records don't end on sblk
+ boundary, 423981: Error running durable perftest)
+
* Thu Dec 06 2007 Alan Conway <aconway(a)redhat.com> - 0.2-4
- Build with optimized flags.
+
* Thu Oct 04 2007 Nuno Santos <nsantos(a)redhat.com> - 0.2-2
- Add rhmd init script
+
* Wed Jul 25 2007 Nuno Santos <nsantos(a)redhat.com> - 0.2-1
- Disable rpath; bump release to match numbers of qpidc trunk packages
+
* Tue Apr 17 2007 Alan Conway <aconway(a)redhat.com> - 0.1-3
- Workaround missing BuildRequires: e2fsprogs-devel in qpidc-devel.
+
* Tue Apr 17 2007 Alan Conway <aconway(a)redhat.com> - 0.1-2
- Added missing BuildRequires: db4-devel
+
* Thu Apr 12 2007 Alan Conway <aconway(a)redhat.com> - 0.1-1
- Initial build.
[View Less]
17 years, 3 months