rhmessaging commits: r1247 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: gordonsim
Date: 2007-11-06 12:28:22 -0500 (Tue, 06 Nov 2007)
New Revision: 1247
Modified:
store/trunk/cpp/tests/persistence.py
Log:
Changed type of in-doubt field for dtx-coordination.recover
Modified: store/trunk/cpp/tests/persistence.py
===================================================================
--- store/trunk/cpp/tests/persistence.py 2007-11-06 17:09:01 UTC (rev 1246)
+++ store/trunk/cpp/tests/persistence.py 2007-11-06 17:28:22 UTC (rev 1247)
@@ -206,19 +206,7 @@
txc = self.xid('c')
txd = self.xid('d')
- indoubt = channel.dtx_coordination_recover().in_doubt
- #convert indoubt table to a list of xids (note: this will change for 0-10)
- data = indoubt["xids"]
- xids = []
- pos = 0
- while pos < len(data):
- size = unpack("!B", data[pos])[0]
- start = pos + 1
- end = start + size
- xid = data[start:end]
- xids.append(xid)
- pos = end
-
+ xids = channel.dtx_coordination_recover().in_doubt
if txc not in xids:
self.fail("Recovered xids not as expected. missing: %s" % (txc))
if txd not in xids:
17 years, 1 month
rhmessaging commits: r1246 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-06 12:09:01 -0500 (Tue, 06 Nov 2007)
New Revision: 1246
Modified:
mgmt/cumin/python/cumin/page.strings
mgmt/notes/justin-todo.txt
Log:
Fixes a possibly inefficient style rule.
Modified: mgmt/cumin/python/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-06 17:01:35 UTC (rev 1245)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-06 17:09:01 UTC (rev 1246)
@@ -20,12 +20,9 @@
border: none;
}
-* {
- text-decoration: none;
-}
-
a {
color: #06c;
+ text-decoration: none;
}
a.selected {
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-06 17:01:35 UTC (rev 1245)
+++ mgmt/notes/justin-todo.txt 2007-11-06 17:09:01 UTC (rev 1246)
@@ -6,9 +6,6 @@
* Queue: Add a msg enq rate msg deq rate chart
- * The * text-decoration: none rule is apparently expensive; find
- another way
-
* Right now, non cumin pages don't print their stack traces in the
log
@@ -20,6 +17,10 @@
* Fix tab order in broker register
+ * Add charts for clients
+
+ * Consumers and Producers tabs are missing rates, as are bindings
+
Deferred
* Make the status lights also be links to an appropriate view
17 years, 1 month
rhmessaging commits: r1245 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-06 12:01:35 -0500 (Tue, 06 Nov 2007)
New Revision: 1245
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/formats.py
mgmt/notes/justin-todo.txt
Log:
Adds a duration formatting function and uses it for session remaining
lifespan.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-06 16:31:53 UTC (rev 1244)
+++ mgmt/cumin/python/cumin/client.py 2007-11-06 17:01:35 UTC (rev 1245)
@@ -140,7 +140,8 @@
return result and "Attached" or "Detached"
def render_item_remaining_lifespan(self, session, session_):
- return session_.get_measurement("remainingLifespan").get_value()
+ value = session_.get_measurement("remainingLifespan").get_value()
+ return fmt_duration(value)
def render_item_frames_outstanding(self, session, session_):
return session_.get_measurement("framesOutstanding").get_value()
Modified: mgmt/cumin/python/cumin/formats.py
===================================================================
--- mgmt/cumin/python/cumin/formats.py 2007-11-06 16:31:53 UTC (rev 1244)
+++ mgmt/cumin/python/cumin/formats.py 2007-11-06 17:01:35 UTC (rev 1245)
@@ -5,6 +5,26 @@
def fmt_datetime(dtime):
return dtime.strftime("%d %b %Y %H:%M")
+# XXX change this to millis or nanos? whatever python wants to give us
+def fmt_duration(secs):
+ """Takes a duration in seconds, which can be a float"""
+
+ elems = list()
+ periods = (86400, 3600, 60, 1)
+ units = ("day", "hour", "min", "sec")
+
+ for period, unit in zip(periods, units):
+ if secs > period:
+ count = secs // period
+ elems.append("%i %s%s" % (count, unit, ess(count)))
+
+ if len(elems) == 2:
+ return ", ".join(elems)
+
+ secs = secs % period
+
+ return ", ".join(elems)
+
def fmt_rate(value, unit1, unit2):
#return "%i <small>%s/%s</small>" % (value, unit1, unit2)
return "%i<small>/%s</small>" % (value, unit2)
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-06 16:31:53 UTC (rev 1244)
+++ mgmt/notes/justin-todo.txt 2007-11-06 17:01:35 UTC (rev 1245)
@@ -18,8 +18,6 @@
in the render_title calls. Perhaps introduce a get_title to solve
this.
- * Display the unit for session remaining lifespan
-
* Fix tab order in broker register
Deferred
17 years, 1 month
rhmessaging commits: r1244 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-06 11:31:53 -0500 (Tue, 06 Nov 2007)
New Revision: 1244
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/notes/justin-todo.txt
Log:
Makes the client list work just like the queue and exchange lists.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-06 16:12:13 UTC (rev 1243)
+++ mgmt/cumin/python/cumin/client.py 2007-11-06 16:31:53 UTC (rev 1244)
@@ -10,9 +10,18 @@
strings = StringCatalog(__file__)
class ClientSet(ItemSet):
+ def __init__(self, app, name):
+ super(ClientSet, self).__init__(app, name)
+
+ self.unit = UnitSwitch(app, "unit")
+ self.add_child(self.unit)
+
def render_title(self, session, vhost):
return "Clients (%i)" % len(vhost.client_items())
+ def render_unit_plural(self, session, vhost):
+ return self.unit.get(session) == "b" and "Bytes" or "Msgs."
+
def get_items(self, session, vhost):
return sorted_by(vhost.client_items(), "address")
@@ -27,18 +36,18 @@
frame.show_view(branch).show_sessions(branch)
return fmt_link(branch.marshal(), len(client.session_items()))
- def render_item_messages_produced(self, session, client):
- return client.get_measurement("msgsProduced").get_value()
+ def render_item_produced(self, session, client):
+ unit = self.unit.get(session)
+ key = unit == "b" and "bytesProduced" or "msgsProduced"
+ value = client.get_measurement(key).get_rate()
+ return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
- def render_item_bytes_produced(self, session, client):
- return client.get_measurement("bytesProduced").get_value()
+ def render_item_consumed(self, session, client):
+ unit = self.unit.get(session)
+ key = unit == "b" and "bytesConsumed" or "msgsConsumed"
+ value = client.get_measurement(key).get_rate()
+ return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
- def render_item_messages_consumed(self, session, client):
- return client.get_measurement("msgsConsumed").get_value()
-
- def render_item_bytes_consumed(self, session, client):
- return client.get_measurement("bytesConsumed").get_value()
-
def render_item_status(self, session, client):
return fmt_status(len(client.errors), len(client.warnings))
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-06 16:12:13 UTC (rev 1243)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-06 16:31:53 UTC (rev 1244)
@@ -1,5 +1,7 @@
[ClientSet.html]
<form>
+ {unit}
+
<div class="sactions">
<h2>Act on Selected Clients:</h2>
<button>Close</button>
@@ -11,10 +13,8 @@
<th><input type="checkbox"/></th>
<th>Address</th>
<th class="ralign">Sessions</th>
- <th class="ralign">Msgs. Produced</th>
- <th class="ralign">Bytes Produced</th>
- <th class="ralign">Msgs. Consumed</th>
- <th class="ralign">Bytes Consumed</th>
+ <th class="ralign">{unit_plural} Produced</th>
+ <th class="ralign">{unit_plural} Consumed</th>
<th>Status</th>
</tr>
@@ -27,10 +27,8 @@
<td><input type="checkbox"/></td>
<td>{item_link}</td>
<td class="ralign">{item_sessions}</td>
- <td class="ralign">{item_messages_produced}</td>
- <td class="ralign">{item_messages_consumed}</td>
- <td class="ralign">{item_bytes_produced}</td>
- <td class="ralign">{item_bytes_consumed}</td>
+ <td class="ralign">{item_produced}</td>
+ <td class="ralign">{item_consumed}</td>
<td>{item_status}</td>
</tr>
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-06 16:12:13 UTC (rev 1243)
+++ mgmt/notes/justin-todo.txt 2007-11-06 16:31:53 UTC (rev 1244)
@@ -20,6 +20,8 @@
* Display the unit for session remaining lifespan
+ * Fix tab order in broker register
+
Deferred
* Make the status lights also be links to an appropriate view
17 years, 1 month
rhmessaging commits: r1243 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-06 11:12:13 -0500 (Tue, 06 Nov 2007)
New Revision: 1243
Modified:
mgmt/cumin/python/cumin/client.py
mgmt/cumin/python/cumin/client.strings
mgmt/notes/justin-todo.txt
Log:
Adds a sessions column to the clients list.
Modified: mgmt/cumin/python/cumin/client.py
===================================================================
--- mgmt/cumin/python/cumin/client.py 2007-11-06 15:59:13 UTC (rev 1242)
+++ mgmt/cumin/python/cumin/client.py 2007-11-06 16:12:13 UTC (rev 1243)
@@ -21,8 +21,11 @@
self.page().show_client(branch, client).show_view(branch)
return fmt_olink(branch, client.address)
- def render_item_status(self, session, client):
- return fmt_status(len(client.errors), len(client.warnings))
+ def render_item_sessions(self, session, client):
+ branch = session.branch()
+ frame = self.page().show_client(branch, client)
+ frame.show_view(branch).show_sessions(branch)
+ return fmt_link(branch.marshal(), len(client.session_items()))
def render_item_messages_produced(self, session, client):
return client.get_measurement("msgsProduced").get_value()
@@ -36,6 +39,9 @@
def render_item_bytes_consumed(self, session, client):
return client.get_measurement("bytesConsumed").get_value()
+ def render_item_status(self, session, client):
+ return fmt_status(len(client.errors), len(client.warnings))
+
class ClientFrame(CuminFrame):
def __init__(self, app, name):
super(ClientFrame, self).__init__(app, name)
@@ -65,8 +71,13 @@
self.add_child(self.tabs)
self.tabs.add_tab(ClientStatistics(app, "stats"))
- self.tabs.add_tab(ClientSessionSet(app, "bindings"))
+ self.sessions = ClientSessionSet(app, "sessions")
+ self.tabs.add_tab(self.sessions)
+
+ def show_sessions(self, session):
+ return self.tabs.show_mode(session, self.sessions)
+
def render_title(self, session, client):
return "Client '%s'" % client.address
Modified: mgmt/cumin/python/cumin/client.strings
===================================================================
--- mgmt/cumin/python/cumin/client.strings 2007-11-06 15:59:13 UTC (rev 1242)
+++ mgmt/cumin/python/cumin/client.strings 2007-11-06 16:12:13 UTC (rev 1243)
@@ -10,6 +10,7 @@
<tr>
<th><input type="checkbox"/></th>
<th>Address</th>
+ <th class="ralign">Sessions</th>
<th class="ralign">Msgs. Produced</th>
<th class="ralign">Bytes Produced</th>
<th class="ralign">Msgs. Consumed</th>
@@ -25,6 +26,7 @@
<tr>
<td><input type="checkbox"/></td>
<td>{item_link}</td>
+ <td class="ralign">{item_sessions}</td>
<td class="ralign">{item_messages_produced}</td>
<td class="ralign">{item_messages_consumed}</td>
<td class="ralign">{item_bytes_produced}</td>
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-06 15:59:13 UTC (rev 1242)
+++ mgmt/notes/justin-todo.txt 2007-11-06 16:12:13 UTC (rev 1243)
@@ -18,6 +18,8 @@
in the render_title calls. Perhaps introduce a get_title to solve
this.
+ * Display the unit for session remaining lifespan
+
Deferred
* Make the status lights also be links to an appropriate view
17 years, 1 month
rhmessaging commits: r1242 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-06 10:59:13 -0500 (Tue, 06 Nov 2007)
New Revision: 1242
Modified:
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/exchange.strings
Log:
Displays rates instead of totals for exchange message receives and
routes.
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-06 15:52:45 UTC (rev 1241)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-06 15:59:13 UTC (rev 1242)
@@ -68,18 +68,20 @@
def render_item_received(self, session, exchange):
unit = self.unit.get(session)
key = unit == "b" and "byteReceives" or "msgReceives"
- return exchange.get_measurement(key).get_value()
+ value = exchange.get_measurement(key).get_rate()
+ return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
+ def render_item_routed(self, session, exchange):
+ unit = self.unit.get(session)
+ key = unit == "b" and "byteRoutes" or "msgRoutes"
+ value = exchange.get_measurement(key).get_rate()
+ return fmt_rate(value, unit == "b" and "byte" or "msg", "sec")
+
def render_item_dropped(self, session, exchange):
unit = self.unit.get(session)
key = unit == "b" and "byteDrops" or "msgDrops"
return exchange.get_measurement(key).get_value()
- def render_item_routed(self, session, exchange):
- unit = self.unit.get(session)
- key = unit == "b" and "byteRoutes" or "msgRoutes"
- return exchange.get_measurement(key).get_value()
-
def render_item_status(self, session, exchange):
return fmt_status(len(exchange.errors), len(exchange.warnings))
Modified: mgmt/cumin/python/cumin/exchange.strings
===================================================================
--- mgmt/cumin/python/cumin/exchange.strings 2007-11-06 15:52:45 UTC (rev 1241)
+++ mgmt/cumin/python/cumin/exchange.strings 2007-11-06 15:59:13 UTC (rev 1242)
@@ -20,8 +20,8 @@
<th class="ralign">Producers</th>
<th class="ralign">Queue Bindings</th>
<th class="ralign">{unit_plural} Received</th>
+ <th class="ralign">{unit_plural} Routed</th>
<th class="ralign">{unit_plural} Dropped</th>
- <th class="ralign">{unit_plural} Routed</th>
<th>Status</th>
</tr>
@@ -34,8 +34,8 @@
<td class="ralign">{item_producers}</td>
<td class="ralign">{item_bindings}</td>
<td class="ralign">{item_received}</td>
+ <td class="ralign">{item_routed}</td>
<td class="ralign">{item_dropped}</td>
- <td class="ralign">{item_routed}</td>
<td>{item_status}</td>
</tr>
17 years, 1 month
rhmessaging commits: r1241 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-06 10:52:45 -0500 (Tue, 06 Nov 2007)
New Revision: 1241
Modified:
mgmt/cumin/python/cumin/exchange.py
mgmt/cumin/python/cumin/queue.py
mgmt/notes/justin-todo.txt
Log:
Makes columns in lists of queues and exchanges links to appropriate
tabs.
Modified: mgmt/cumin/python/cumin/exchange.py
===================================================================
--- mgmt/cumin/python/cumin/exchange.py 2007-11-05 22:54:56 UTC (rev 1240)
+++ mgmt/cumin/python/cumin/exchange.py 2007-11-06 15:52:45 UTC (rev 1241)
@@ -54,10 +54,16 @@
return fmt_olink(branch, exchange)
def render_item_producers(self, session, exchange):
- return len(exchange.producer_items())
+ branch = session.branch()
+ frame = self.page().show_exchange(branch, exchange)
+ frame.show_view(branch).show_producers(branch)
+ return fmt_link(branch.marshal(), len(exchange.producer_items()))
def render_item_bindings(self, session, exchange):
- return len(exchange.binding_items())
+ branch = session.branch()
+ frame = self.page().show_exchange(branch, exchange)
+ frame.show_view(branch).show_bindings(branch)
+ return fmt_link(branch.marshal(), len(exchange.binding_items()))
def render_item_received(self, session, exchange):
unit = self.unit.get(session)
Modified: mgmt/cumin/python/cumin/queue.py
===================================================================
--- mgmt/cumin/python/cumin/queue.py 2007-11-05 22:54:56 UTC (rev 1240)
+++ mgmt/cumin/python/cumin/queue.py 2007-11-06 15:52:45 UTC (rev 1241)
@@ -41,10 +41,16 @@
return queue.name
def render_item_consumers(self, session, queue):
- return queue.get_measurement("consumers").get_value()
+ branch = session.branch()
+ frame = self.page().show_queue(branch, queue)
+ frame.show_view(branch).show_consumers(branch)
+ return fmt_link(branch.marshal(), len(queue.consumer_items()))
def render_item_bindings(self, session, queue):
- return len(queue.binding_items())
+ branch = session.branch()
+ frame = self.page().show_queue(branch, queue)
+ frame.show_view(branch).show_bindings(branch)
+ return fmt_link(branch.marshal(), len(queue.binding_items()))
def render_item_enqueued(self, session, queue):
unit = self.unit.get(session)
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-05 22:54:56 UTC (rev 1240)
+++ mgmt/notes/justin-todo.txt 2007-11-06 15:52:45 UTC (rev 1241)
@@ -1,7 +1,5 @@
Current
- * exch, queue: make consumer, producer, and bindings columns links
-
* Add ability to send a test message to a queue
* Use page attributes for session errors, redirect
17 years, 1 month
rhmessaging commits: r1240 - store/trunk/cpp/tests.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-11-05 17:54:56 -0500 (Mon, 05 Nov 2007)
New Revision: 1240
Modified:
store/trunk/cpp/tests/
Log:
Edited svn:ignore properties for tests dir
Property changes on: store/trunk/cpp/tests
___________________________________________________________________
Name: svn:ignore
- .deps
.libs
Makefile
Makefile.in
gen.mk
vg-log.1
vg-log.2
vg-log.3
vg-log.4
+ .deps
.libs
Makefile
Makefile.in
gen.mk
qpid.log
vg-log.bdb.1
vg-log.bdb.2
vg-log.bdb.3
vg-log.bdb.4
vg-log.bdb.5
vg-log.bdb.6
vg-log.jrnl.1
vg-log.jrnl.2
vg-log.jrnl.3
vg-log.jrnl.4
vg-log.jrnl.5
vg-log.jrnl.6
17 years, 1 month
rhmessaging commits: r1239 - in store/trunk/cpp: lib/jrnl and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2007-11-05 17:51:24 -0500 (Mon, 05 Nov 2007)
New Revision: 1239
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/BdbMessageStore.h
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/TxnCtxt.h
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/jexception.cpp
store/trunk/cpp/lib/jrnl/jexception.hpp
store/trunk/cpp/tests/jrnl/JournalSystemTests.cpp
Log:
Added inactivity timer to JournalImpl which forces a flush in the event of write activity that leaves unwritten data in the journal page cache. Note that the test that specifically tests this ability is not yet available.
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-11-05 22:51:24 UTC (rev 1239)
@@ -44,8 +44,8 @@
static const u_int8_t MESSAGE_MESSAGE = 1;
static const u_int8_t BASIC_MESSAGE = 2;
bool BdbMessageStore::useAsync;
-qpid::sys::Duration BdbMessageStore::defJournalTimeout(1000); // 1ms (timeout value is in nanoseconds)
-
+qpid::sys::Duration BdbMessageStore::defJournalGetEventsTimeout(1000000); // 1ms
+qpid::sys::Duration BdbMessageStore::defJournalFlushTimeout(1000000000); // 1 sec
unsigned int TxnCtxt::count = 0;
@@ -190,8 +190,7 @@
journal::jdir::delete_dir(getJrnlBaseDir(),true);
}
catch ( journal::jexception& e) {
- std::string str;
- THROW_STORE_EXCEPTION("Truncate clean up failed: " +e.to_string(str) );
+ THROW_STORE_EXCEPTION("Truncate clean up failed: " +e.to_string() );
}
}
@@ -202,14 +201,13 @@
THROW_STORE_EXCEPTION("Queue already created: " + queue.getName());
}
if (usingJrnl()) {
- JournalImpl* jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue), string("JournalData"), defJournalTimeout);
+ JournalImpl* 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();
} catch (journal::jexception& e) {
- std::string s;
- THROW_STORE_EXCEPTION(e.to_string(s) + queue.getName());
+ THROW_STORE_EXCEPTION(e.to_string() + queue.getName());
}
}
@@ -381,7 +379,7 @@
if (usingJrnl())
{
const char* queueName = queue->getName().c_str();
- JournalImpl* jQueue = new JournalImpl(queueName, getJrnlDir(queueName), string("JournalData"), defJournalTimeout);
+ JournalImpl* jQueue = new JournalImpl(queueName, getJrnlDir(queueName), string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout);
queue->setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
try
@@ -390,8 +388,7 @@
recoverMessages(txn, registry, queue, prepared, messages);
jQueue->recover_complete(); // start journal.
} catch (const journal::jexception& e) {
- std::string s;
- THROW_STORE_EXCEPTION(e.to_string(s) + queueName);
+ THROW_STORE_EXCEPTION(e.to_string() + queueName);
}
//read all messages: done on a per queue basis if using Journal
}
@@ -819,8 +816,7 @@
// jc->get_wr_events();
}
}catch ( journal::jexception& e) {
- std::string str;
- THROW_STORE_EXCEPTION("Flush failed: " + e.to_string(str) );
+ THROW_STORE_EXCEPTION("Flush failed: " + e.to_string() );
}
}
@@ -931,9 +927,8 @@
}
}
}catch ( journal::jexception& e) {
- std::string str;
// std::cout << "-------------" << e << std::endl;
- THROW_STORE_EXCEPTION("Enqueue failed: " +e.to_string(str) );
+ THROW_STORE_EXCEPTION("Enqueue failed: " +e.to_string() );
}catch (DbException& e) {
THROW_STORE_EXCEPTION_2("Error storing message", e);
}
@@ -1021,8 +1016,7 @@
dres = jc->dequeue_txn_data_record(ddtokp.get(), tid);
}
} catch (rhm::journal::jexception& e) {
- std::string str;
- THROW_STORE_EXCEPTION("Error dequeuing message" + e.to_string(str));
+ THROW_STORE_EXCEPTION("Error dequeuing message" + e.to_string());
}
switch (dres)
{
Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/BdbMessageStore.h 2007-11-05 22:51:24 UTC (rev 1239)
@@ -77,7 +77,8 @@
std::string storeDir;
bool isInit;
const char* envPath;
- static qpid::sys::Duration defJournalTimeout;
+ static qpid::sys::Duration defJournalGetEventsTimeout;
+ static qpid::sys::Duration defJournalFlushTimeout;
bool mode(const bool mode, const bool force);
void recoverQueues(TxnCtxt& txn, qpid::broker::RecoveryManager& recovery, queue_index& index,
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2007-11-05 22:51:24 UTC (rev 1239)
@@ -28,30 +28,38 @@
using namespace rhm::bdbstore;
using namespace rhm::journal;
-qpid::broker::TimerA JournalImpl::journalGetEventsTimer;
+qpid::broker::TimerA JournalImpl::journalTimer;
+void InactivityFireEvent::fire() { if (parent) parent->flushFire(); }
+void GetEventsFireEvent::fire() { if (parent) parent->getEventsFire(); unref(); }
JournalImpl::JournalImpl(const std::string& journalId,
const std::string& journalDirectory,
const std::string& journalBaseFilename,
- const qpid::sys::Duration timeout):
+ const qpid::sys::Duration getEventsTimeout,
+ const qpid::sys::Duration flushTimeout):
jcntl(journalId, journalDirectory, journalBaseFilename),
- timerSetFlag(false)
+ getEventsTimerSetFlag(false),
+ writeActivityFlag(false),
+ flushTriggeredFlag(true)
{
- fireEventPtr = new FireEvent(this, timeout);
- journalGetEventsTimer.start();
+ getEventsFireEventsPtr = new GetEventsFireEvent(this, getEventsTimeout);
+ inactivityFireEventPtr = new InactivityFireEvent(this, flushTimeout);
+ journalTimer.start();
+ journalTimer.add(inactivityFireEventPtr);
}
JournalImpl::~JournalImpl()
{
- //fireEventPtr->cancel();
+ (dynamic_cast<GetEventsFireEvent*>(getEventsFireEventsPtr.get()))->cancel();
+ (dynamic_cast<InactivityFireEvent*>(inactivityFireEventPtr.get()))->cancel();
}
void
-JournalImpl::recover(std::deque<journal::data_tok*>* rd_dtokl, const journal::aio_cb rd_cb,
- std::deque<journal::data_tok*>* wr_dtokl, const journal::aio_cb wr_cb,
+JournalImpl::recover(std::deque<data_tok*>* rd_dtokl, const aio_cb rd_cb,
+ std::deque<data_tok*>* wr_dtokl, const aio_cb wr_cb,
boost::ptr_list<bdbstore::PreparedTransaction>& prep_tx_list, u_int64_t queue_id)
- throw (journal::jexception)
+ throw (jexception)
{
// Create list of prepared xids
std::vector<std::string> prep_xid_list;
@@ -60,15 +68,15 @@
prep_xid_list.push_back(i->xid);
}
- journal::jcntl::recover(rd_dtokl, rd_cb, wr_dtokl, wr_cb, prep_xid_list);
+ jcntl::recover(rd_dtokl, rd_cb, wr_dtokl, wr_cb, prep_xid_list);
// Populate PreparedTransaction lists from _tmap
for (bdbstore::PreparedTransaction::list::iterator i = prep_tx_list.begin();
i != prep_tx_list.end(); i++) {
try {
- journal::txn_data_list tdl = _tmap.get_tdata_list(i->xid);
+ txn_data_list tdl = _tmap.get_tdata_list(i->xid);
assert(tdl.size()); // should never be empty
- for (journal::tdl_itr tdl_itr = tdl.begin(); tdl_itr < tdl.end(); tdl_itr++) {
+ for (tdl_itr tdl_itr = tdl.begin(); tdl_itr < tdl.end(); tdl_itr++) {
if (tdl_itr->_enq_flag) { // enqueue op
i->enqueues->add(queue_id, tdl_itr->_rid);
} else { // dequeue op
@@ -76,42 +84,121 @@
}
}
}
- catch (const journal::jexception& e) {
- if (e.err_code() != journal::jerrno::JERR_MAP_NOTFOUND)
+ catch (const jexception& e) {
+ if (e.err_code() != jerrno::JERR_MAP_NOTFOUND)
throw e;
}
}
}
+const iores
+JournalImpl::enqueue_data_record(const void* const data_buff, const size_t tot_data_len,
+ const size_t this_data_len, data_tok* dtokp, const bool transient)
+ throw (jexception)
+{
+//std::cout << " " << _jid << ":E" << std::flush;
+ return handleInactivityTimer(jcntl::enqueue_data_record(data_buff, tot_data_len,
+ this_data_len, dtokp, transient));
+}
+
+const iores
+JournalImpl::enqueue_txn_data_record(const void* const data_buff, const size_t tot_data_len,
+ const size_t this_data_len, data_tok* dtokp, const std::string& xid,
+ const bool transient) throw (jexception)
+{
+//std::cout << " " << _jid << ":Etx" << std::flush;
+ return handleInactivityTimer(jcntl::enqueue_txn_data_record(data_buff, tot_data_len,
+ this_data_len, dtokp, xid, transient));
+}
+
+const iores
+JournalImpl::dequeue_data_record(data_tok* const dtokp) throw (jexception)
+{
+//std::cout << " " << _jid << ":D" << std::flush;
+ return handleInactivityTimer(jcntl::dequeue_data_record(dtokp));
+}
+
+const iores
+JournalImpl::dequeue_txn_data_record(data_tok* const dtokp, const std::string& xid)
+ throw (jexception)
+{
+//std::cout << " " << _jid << ":Dtx" << std::flush;
+ return handleInactivityTimer(jcntl::dequeue_txn_data_record(dtokp, xid));
+}
+
+const iores
+JournalImpl::txn_abort(data_tok* const dtokp, const std::string& xid) throw (jexception)
+{
+//std::cout << " " << _jid << ":Atx" << std::flush;
+ return handleInactivityTimer(jcntl::txn_abort(dtokp, xid));
+}
+
+const iores
+JournalImpl::txn_commit(data_tok* const dtokp, const std::string& xid) throw (jexception)
+{
+//std::cout << " " << _jid << ":Ctx" << std::flush;
+ return handleInactivityTimer(jcntl::txn_commit(dtokp, xid));
+}
+
void
-JournalImpl::flush() throw (journal::jexception)
+JournalImpl::stop(bool block_till_aio_cmpl) throw (jexception)
{
+ (dynamic_cast<InactivityFireEvent*>(inactivityFireEventPtr.get()))->cancel();
+ jcntl::stop(block_till_aio_cmpl);
+}
+
+void
+JournalImpl::flush() throw (jexception)
+{
jcntl::flush();
- handleEventTimer((const iores)0);
+ if (_wmgr.get_aio_evt_rem() && !getEventsTimerSetFlag) {
+ intrusive_ptr_add_ref(getEventsFireEventsPtr.get());
+ journalTimer.add(getEventsFireEventsPtr);
+ getEventsTimerSetFlag = true;
+ }
}
void
-JournalImpl::fire()
+JournalImpl::getEventsFire()
{
if (_wmgr.get_aio_evt_rem()) {
- jcntl::get_wr_events();
+ try { jcntl::get_wr_events(); }
+ catch (const jexception& e)
+ {
+ // Another thread has already called get_wr_events() and it is still busy, ignore
+ if (e.err_code() != jerrno::JERR__PTHREAD) {
+ throw e;
+ }
+ }
}
- timerSetFlag = false;
+ getEventsTimerSetFlag = false;
if (_wmgr.get_aio_evt_rem()) {
- intrusive_ptr_add_ref(fireEventPtr.get());
- journalGetEventsTimer.add(fireEventPtr);
- timerSetFlag = true;
+ intrusive_ptr_add_ref(getEventsFireEventsPtr.get());
+ journalTimer.add(getEventsFireEventsPtr);
+ getEventsTimerSetFlag = true;
}
}
-const iores
-JournalImpl::handleEventTimer(const iores res)
+void
+JournalImpl::flushFire()
{
- if (_wmgr.get_aio_evt_rem() && !timerSetFlag) {
- intrusive_ptr_add_ref(fireEventPtr.get());
- journalGetEventsTimer.add(fireEventPtr);
- timerSetFlag = true;
+ if (writeActivityFlag) {
+ writeActivityFlag = false;
+ flushTriggeredFlag = false;
+ } else {
+ if (!flushTriggeredFlag) {
+ flush();
+ flushTriggeredFlag = true;
+ }
}
- return res;
+ inactivityFireEventPtr->reset();
+ journalTimer.add(inactivityFireEventPtr);
}
+const iores
+JournalImpl::handleInactivityTimer(const iores r) throw (jexception)
+{
+ writeActivityFlag = true;
+ return r;
+}
+
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/JournalImpl.h 2007-11-05 22:51:24 UTC (rev 1239)
@@ -36,21 +36,50 @@
namespace rhm {
namespace bdbstore {
- class FireEvent;
+ class JournalImpl;
+ class InactivityFireEvent : public virtual qpid::broker::TimerTaskA
+ {
+ JournalImpl* parent;
+
+ public:
+ InactivityFireEvent(JournalImpl* p, const qpid::sys::Duration timeout):
+ qpid::broker::TimerTaskA(timeout), parent(p) {}
+ virtual ~InactivityFireEvent() {}
+ void fire();
+ inline void cancel() { parent=0; }
+ };
+
+ class GetEventsFireEvent : public virtual qpid::broker::TimerTaskA
+ {
+ JournalImpl* parent;
+
+ public:
+ GetEventsFireEvent(JournalImpl* p, const qpid::sys::Duration timeout):
+ qpid::broker::TimerTaskA(timeout), parent(p) {}
+ virtual ~GetEventsFireEvent() {}
+ void fire();
+ inline void cancel() { parent=0; }
+ };
+
class JournalImpl : public journal::jcntl
{
private:
- static qpid::broker::TimerA journalGetEventsTimer;
- bool timerSetFlag;
- qpid::broker::TimerTaskA::intrusive_ptr fireEventPtr;
-
+ static qpid::broker::TimerA journalTimer;
+ bool getEventsTimerSetFlag;
+ qpid::broker::TimerTaskA::intrusive_ptr getEventsFireEventsPtr;
+
+ bool writeActivityFlag;
+ bool flushTriggeredFlag;
+ qpid::broker::TimerTaskA::intrusive_ptr inactivityFireEventPtr;
+
public:
JournalImpl(const std::string& journalId,
const std::string& journalDirectory,
const std::string& journalBaseFilename,
- const qpid::sys::Duration timeout);
+ const qpid::sys::Duration getEventsTimeout,
+ const qpid::sys::Duration flushTimeout);
~JournalImpl();
void recover(std::deque<journal::data_tok*>* rd_dtokl, const journal::aio_cb rd_cb,
@@ -65,30 +94,43 @@
&aio_wr_callback, prep_tx_list, queue_id);
}
+ // Overrides for write inactivity timer
+ const journal::iores enqueue_data_record(const void* const data_buff,
+ const size_t tot_data_len, const size_t this_data_len, journal::data_tok* dtokp,
+ const bool transient = false) throw (journal::jexception);
+
+ const journal::iores enqueue_txn_data_record(const void* const data_buff,
+ const size_t tot_data_len, const size_t this_data_len, journal::data_tok* dtokp,
+ const std::string& xid, const bool transient = false)
+ throw (journal::jexception);
+
+ const journal::iores dequeue_data_record(journal::data_tok* const dtokp)
+ throw (journal::jexception);
+
+ const journal::iores dequeue_txn_data_record(journal::data_tok* const dtokp,
+ const std::string& xid) throw (journal::jexception);
+
+ const journal::iores txn_abort(journal::data_tok* const dtokp, const std::string& xid)
+ throw (journal::jexception);
+
+ const journal::iores txn_commit(journal::data_tok* const dtokp, const std::string& xid)
+ throw (journal::jexception);
+
+ void stop(bool block_till_aio_cmpl = false) throw (journal::jexception);
+
+ // Overrides for get_events timer
void flush() throw (journal::jexception);
// TimerTask callback
- void fire();
-
+ void getEventsFire();
+ void flushFire();
+
private:
- const journal::iores handleEventTimer(const journal::iores res);
- };
-
- class FireEvent : public virtual qpid::broker::TimerTaskA
- {
- JournalImpl* parent;
+ const journal::iores handleInactivityTimer(const journal::iores r)
+ throw (journal::jexception);
+ }; // class JournalImpl
- public:
- FireEvent(JournalImpl* p, const qpid::sys::Duration timeout):
- qpid::broker::TimerTaskA(timeout), parent(p) {}
- virtual ~FireEvent() {}
- inline void fire() { if (parent) parent->fire(); unref(); }
- inline void cancel() { cancelled=true; parent=0; }
- };
+ } // namespace bdbstore
+} // namespace rhm
-
-
- } // namespace bdbstore
- } // namespace rhm
-
#endif
Modified: store/trunk/cpp/lib/TxnCtxt.h
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.h 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/TxnCtxt.h 2007-11-05 22:51:24 UTC (rev 1239)
@@ -76,9 +76,8 @@
jc->txn_abort(dtokp.get(), getXid());
}
} catch (rhm::journal::jexception& e) {
- std::string str;
//std::cout << "Error commit" << e << std::endl;
- THROW_STORE_EXCEPTION("Error commit" + e.to_string(str));
+ THROW_STORE_EXCEPTION("Error commit" + e.to_string());
}
}
@@ -117,9 +116,8 @@
jc->get_wr_events();
}
}catch (rhm::journal::jexception& e) {
- std::string str;
//std::cout << " TxnCtxt: Error sync 3" << e << std::flush;
- THROW_STORE_EXCEPTION("Error sync" + e.to_string(str));
+ THROW_STORE_EXCEPTION("Error sync" + e.to_string());
}
}
firstloop = false;
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-11-05 22:51:24 UTC (rev 1239)
@@ -72,7 +72,7 @@
{
if (_init_flag && !_stop_flag)
try { stop(true); }
- catch (jexception e) { std::cerr << e << std::endl; }
+ catch (const jexception& e) { std::cerr << e << std::endl; }
if (_datafh)
{
for (u_int32_t i=0; i<JRNL_NUM_FILES; i++)
@@ -304,6 +304,16 @@
}
}
+void
+jcntl::flush() throw (jexception)
+{
+ if (!_init_flag)
+ return;
+ if (_readonly_flag)
+ throw jexception(jerrno::JERR_JCNTL_READONLY, "jcntl", "flush");
+ _wmgr.flush();
+}
+
// Private functions
void
@@ -372,7 +382,7 @@
rd._ffid = ji.get_start_file();
rd._empty = false;
}
- catch (jexception& e)
+ catch (const jexception& e)
{
if (e.err_code() != jerrno::JERR_JINF_JDATEMPTY)
throw e;
@@ -441,7 +451,11 @@
{
// If the enqueue is part of a pending txn, it will not yet be in emap
try { _emap.lock(dr.deq_rid()); }
- catch(jexception e) { if (e.err_code() != jerrno::JERR_MAP_NOTFOUND) throw e; }
+ catch(const jexception& e)
+ {
+ if (e.err_code() != jerrno::JERR_MAP_NOTFOUND)
+ throw e;
+ }
dr.get_xid(&xidp);
assert(xidp != NULL);
std::string xid((char*)xidp, dr.xid_size());
@@ -455,7 +469,7 @@
_emap.get_remove_fid(dr.deq_rid());
rd._enq_cnt_list[fid]--;
}
- catch (jexception& e)
+ catch (const jexception& e)
{
if (e.err_code() != jerrno::JERR_MAP_NOTFOUND)
throw e;
@@ -485,7 +499,7 @@
if (!itr->_enq_flag)
_emap.unlock(itr->_drid);
}
- catch(jexception e)
+ catch(const jexception& e)
{
if (e.err_code() != jerrno::JERR_MAP_NOTFOUND)
throw e;
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-11-05 22:51:24 UTC (rev 1239)
@@ -531,7 +531,7 @@
/**
* \brief Force a flush of the write page cache, creating a single AIO write operation.
*/
- inline void flush() throw (jexception) { _wmgr.flush(); }
+ void flush() throw (jexception);
inline const u_int32_t get_enq_cnt() const { return _emap.size(); }
inline const u_int32_t get_wr_outstanding_aio_dblks() const
Modified: store/trunk/cpp/lib/jrnl/jexception.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jexception.cpp 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/jrnl/jexception.cpp 2007-11-05 22:51:24 UTC (rev 1239)
@@ -83,8 +83,8 @@
jexception::~jexception() throw ()
{}
-const std::string&
-jexception::to_string(std::string& str) const
+const std::string
+jexception::to_string() const
{
std::stringstream ss;
if (!_throwing_class.empty() && !_throwing_fn.empty())
@@ -96,28 +96,27 @@
ss << " " << err_msg;
if (!_additional_info.empty())
ss << " (" << _additional_info << ")";
- return str.assign(ss.str());
+ return ss.str();
}
const char*
jexception::what() const throw ()
{
- return _additional_info.c_str();
+// return _additional_info.c_str();
+ return to_string().c_str();
}
std::ostream&
operator<<(std::ostream& os, const jexception& je)
{
- std::string str;
- os << je.to_string(str);
+ os << je.to_string();
return os;
}
std::ostream&
operator<<(std::ostream& os, const jexception* jePtr)
{
- std::string str;
- os << jePtr->to_string(str);
+ os << jePtr->to_string();
return os;
}
Modified: store/trunk/cpp/lib/jrnl/jexception.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jexception.hpp 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/lib/jrnl/jexception.hpp 2007-11-05 22:51:24 UTC (rev 1239)
@@ -72,7 +72,7 @@
jexception(const u_int32_t err_code, const std::string& additional_info,
const std::string& throwing_class, const std::string& throwing_fn);
virtual ~jexception() throw ();
- const std::string& to_string(std::string& str) const;
+ const std::string to_string() const;
virtual const char* what() const throw (); // override std::exception::what()
inline const u_int32_t err_code() const { return _err_code; }
Modified: store/trunk/cpp/tests/jrnl/JournalSystemTests.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/JournalSystemTests.cpp 2007-11-05 22:23:04 UTC (rev 1238)
+++ store/trunk/cpp/tests/jrnl/JournalSystemTests.cpp 2007-11-05 22:51:24 UTC (rev 1239)
@@ -1410,8 +1410,7 @@
catch (rhm::journal::jexception e)
{
t.finalize();
- std::string s;
- CPPUNIT_FAIL(e.to_string(s));
+ CPPUNIT_FAIL(e.to_string());
}
t.finalize();
}
17 years, 1 month
rhmessaging commits: r1238 - in mgmt: notes and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-11-05 17:23:04 -0500 (Mon, 05 Nov 2007)
New Revision: 1238
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/page.strings
mgmt/cumin/python/cumin/queue.strings
mgmt/notes/justin-todo.txt
Log:
Adds the form for registering sets of brokers.
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2007-11-05 20:18:03 UTC (rev 1237)
+++ mgmt/cumin/python/cumin/broker.py 2007-11-05 22:23:04 UTC (rev 1238)
@@ -394,6 +394,11 @@
def render_none(self, session, model):
return fmt_none()
+ def render_add_broker_href(self, session, model):
+ branch = session.branch()
+ self.page().show_broker_add(session)
+ return branch.marshal()
+
def render_clear_filters_href(self, session, model):
branch = session.branch()
self.group.set(branch, None)
@@ -442,3 +447,82 @@
class_ = param.get(session) is object and "selected"
return fmt_link(href, name, class_)
+
+class BrokerForm(CuminForm, Frame):
+ def __init__(self, app, name):
+ super(BrokerForm, self).__init__(app, name)
+
+ self.name_param = Parameter(app, "name_param");
+ self.add_parameter(self.name_param)
+ self.add_form_parameter(self.name_param)
+
+ self.names = ListParameter(app, "name", self.name_param)
+ self.add_parameter(self.names)
+ self.add_form_parameter(self.names)
+
+ self.addr_param = Parameter(app, "addr_param")
+ self.add_parameter(self.addr_param)
+ self.add_form_parameter(self.addr_param)
+
+ self.addrs = ListParameter(app, "address", self.addr_param)
+ self.add_parameter(self.addrs)
+ self.add_form_parameter(self.addrs)
+
+ self.fields = IntegerParameter(app, "fields")
+ self.fields.set_default(3)
+ self.add_parameter(self.fields)
+
+ self.field_tmpl = Template(self, "field_html")
+
+ self.more = self.MoreEntries(app, "more", self)
+ self.add_child(self.more)
+
+ def process_display(self, session, object):
+ if self.more.get(session):
+ self.fields.set(session, self.fields.get(session) + 3)
+
+ def render_fields(self, session, object):
+ writer = Writer()
+
+ for i in range(self.fields.get(session)):
+ self.field_tmpl.render(session, i, writer)
+
+ return writer.to_string()
+
+ def render_field_name_name(self, session, object):
+ return self.names.path()
+
+ def render_field_name_value(self, session, index):
+ names = self.names.get(session)
+ if len(names) > index:
+ return names[index]
+
+ def render_field_address_name(self, session, object):
+ return self.addrs.path()
+
+ def render_field_address_value(self, session, index):
+ addrs = self.addrs.get(session)
+ if len(addrs) > index:
+ return addrs[index]
+
+ class MoreEntries(FormButton):
+ def render_content(self, session, model):
+ return "More Entries"
+
+class BrokerAdd(BrokerForm):
+ def process_cancel(self, session, model):
+ branch = session.branch()
+ self.page().show_view(branch)
+ session.set_redirect(branch.marshal())
+
+ def process_submit(self, session, model):
+ names = self.names.get(session)
+ addrs = self.addrs.get(session)
+
+ for name, addr in zip(names, addrs):
+ print name, addr
+
+ self.process_cancel(session, model)
+
+ def render_title(self, session, object):
+ return "Register New Brokers"
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2007-11-05 20:18:03 UTC (rev 1237)
+++ mgmt/cumin/python/cumin/broker.strings 2007-11-05 22:23:04 UTC (rev 1238)
@@ -180,7 +180,7 @@
</td>
<td class="view">
<ul class="actions">
- <li><a class="nav" href="{href}">Register New Brokers</a></li>
+ <li><a class="nav" href="{add_broker_href}">Register New Brokers</a></li>
</ul>
{brokers}
@@ -196,3 +196,49 @@
[BrokerBrowser.cluster_html]
<li>{cluster_link}</li>
+
+[BrokerForm.css]
+table.BrokerForm td, table.BrokerForm th {
+ padding: 0.25em;
+}
+
+[BrokerForm.html]
+<form id="{id}" class="mform" method="post" action="?">
+ <div class="head">
+ <h1>{title}</h1>
+ </div>
+ <div class="body">
+ <fieldset>
+ <table class="BrokerForm">
+ <tr>
+ <th>Name</th>
+ <th>Address</th>
+ </tr>
+
+ {fields}
+ </table>
+
+ {more}
+ </fieldset>
+
+ {hidden_inputs}
+ </div>
+ <div class="foot">
+ <a class="help action" href="{href}" target="help">Help</a>
+ {cancel}
+ {submit}
+ </div>
+</form>
+<script defer="defer">
+(function() {
+ var elem = wooly.doc().elem("{id}").node.elements[1];
+ elem.focus();
+ elem.select();
+}())
+</script>
+
+[BrokerForm.field_html]
+<tr>
+ <td><input type="text" name="{field_name_name}" value="{field_name_value}" size="20"/></td>
+ <td><input type="text" name="{field_address_name}" value="{field_address_value}" size="40"/></td>
+</tr>
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-11-05 20:18:03 UTC (rev 1237)
+++ mgmt/cumin/python/cumin/page.py 2007-11-05 22:23:04 UTC (rev 1238)
@@ -32,6 +32,9 @@
self.broker = BrokerFrame(app, "broker")
self.add_mode(self.broker)
+ self.broker_add = BrokerAdd(app, "brokeradd")
+ self.add_mode(self.broker_add)
+
self.group = BrokerGroupFrame(app, "group")
self.add_mode(self.group)
@@ -77,6 +80,10 @@
return self.set_current_frame(session, frame)
+ def show_broker_add(self, session):
+ frame = self.show_mode(session, self.broker_add)
+ 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/cumin/page.strings
===================================================================
--- mgmt/cumin/python/cumin/page.strings 2007-11-05 20:18:03 UTC (rev 1237)
+++ mgmt/cumin/python/cumin/page.strings 2007-11-05 22:23:04 UTC (rev 1238)
@@ -44,6 +44,7 @@
tr {
vertical-align: top;
+ text-align: left;
}
span.none {
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2007-11-05 20:18:03 UTC (rev 1237)
+++ mgmt/cumin/python/cumin/queue.strings 2007-11-05 22:23:04 UTC (rev 1238)
@@ -45,7 +45,7 @@
</tr>
[QueueForm.html]
-<form id="{id}" class="QueueForm mform" method="post" action="?">
+<form id="{id}" class="mform" method="post" action="?">
<div class="head">
<h1>{title}</h1>
</div>
Modified: mgmt/notes/justin-todo.txt
===================================================================
--- mgmt/notes/justin-todo.txt 2007-11-05 20:18:03 UTC (rev 1237)
+++ mgmt/notes/justin-todo.txt 2007-11-05 22:23:04 UTC (rev 1238)
@@ -1,9 +1,5 @@
Current
- * Brokers tab
-
- - Find/connect in bulk
-
* exch, queue: make consumer, producer, and bindings columns links
* Add ability to send a test message to a queue
17 years, 1 month