rhmessaging commits: r1038 - in mgmt/cumin: python/wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 22:49:17 -0400 (Fri, 12 Oct 2007)
New Revision: 1038
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/wooly/devel.py
Log:
Small profiling and benchmarking changes.
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2007-10-13 02:04:26 UTC (rev 1037)
+++ mgmt/cumin/bin/cumin-test 2007-10-13 02:49:17 UTC (rev 1038)
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import sys, profile, pstats
+from time import time
from wooly.devel import BenchmarkHarness
from wooly.server import WebServer
@@ -42,21 +43,21 @@
server = WebServer(app, port)
server.run()
-def main(sargs):
- args = load_args(sargs)
+def main():
+ args = load_args(sys.argv)
in_port = int(args.get("port", 9090))
- in_debug = True
in_profile = "profile" in args
+ in_debug = "no-debug" not in args
in_bench = "bench" in args
in_demodata = "no-demo-data" not in args
- stats_file = "/tmp/cumin-test-stats"
+ stats_file = "/tmp/cumin-test-stats-%i" % time()
if in_profile:
try:
code = "do_main(%i, %r, %r, %r)" % \
- (in_port, False, in_bench, in_demodata)
+ (in_port, in_debug, in_bench, in_demodata)
profile.run(code, stats_file)
raise KeyboardInterrupt()
except KeyboardInterrupt:
@@ -73,4 +74,4 @@
pass
if __name__ == "__main__":
- main(sys.argv)
+ main()
Modified: mgmt/cumin/python/wooly/devel.py
===================================================================
--- mgmt/cumin/python/wooly/devel.py 2007-10-13 02:04:26 UTC (rev 1037)
+++ mgmt/cumin/python/wooly/devel.py 2007-10-13 02:49:17 UTC (rev 1038)
@@ -14,13 +14,11 @@
count = 0
while True:
- try:
- url = self.app.debug.urls.pop()
- except KeyError:
- return
+ for url in self.app.debug.urls:
+ if url not in visited:
+ visited.add(url)
+ break
- visited.add(url)
-
start = clock()
session = Session(self.app)
17 years, 2 months
rhmessaging commits: r1037 - in mgmt/cumin: python/wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 22:04:26 -0400 (Fri, 12 Oct 2007)
New Revision: 1037
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/wooly/devel.py
mgmt/cumin/python/wooly/model.py
Log:
More cumin-test updates.
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2007-10-13 01:40:04 UTC (rev 1036)
+++ mgmt/cumin/bin/cumin-test 2007-10-13 02:04:26 UTC (rev 1037)
@@ -62,8 +62,8 @@
except KeyboardInterrupt:
stats = pstats.Stats(stats_file)
- stats.sort_stats("cumulative").print_stats(15)
- stats.sort_stats("time").print_stats(15)
+ stats.sort_stats("cumulative").print_stats(40)
+ stats.sort_stats("time").print_stats(40)
stats.strip_dirs()
else:
Modified: mgmt/cumin/python/wooly/devel.py
===================================================================
--- mgmt/cumin/python/wooly/devel.py 2007-10-13 01:40:04 UTC (rev 1036)
+++ mgmt/cumin/python/wooly/devel.py 2007-10-13 02:04:26 UTC (rev 1037)
@@ -9,12 +9,18 @@
self.app = app
def run(self):
+ visited = set()
self.app.debug.urls.add("")
count = 0
while True:
- url = sample(self.app.debug.urls, 1)[0]
+ try:
+ url = self.app.debug.urls.pop()
+ except KeyError:
+ return
+ visited.add(url)
+
start = clock()
session = Session(self.app)
Modified: mgmt/cumin/python/wooly/model.py
===================================================================
--- mgmt/cumin/python/wooly/model.py 2007-10-13 01:40:04 UTC (rev 1036)
+++ mgmt/cumin/python/wooly/model.py 2007-10-13 02:04:26 UTC (rev 1037)
@@ -16,6 +16,9 @@
def unlock(self):
self.__lock.release()
+ def get_object(self, mclass, id):
+ self.get_index(mclass).get(id)
+
class ModelClass(object):
def __init__(self, model, name):
self.model = model
17 years, 2 months
rhmessaging commits: r1036 - in mgmt/cumin: python/wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 21:40:04 -0400 (Fri, 12 Oct 2007)
New Revision: 1036
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/wooly/__init__.py
mgmt/cumin/python/wooly/devel.py
mgmt/cumin/python/wooly/server.py
Log:
More cumin-test improvements. Adds a --bench option to run randomly
selected page views in a loop.
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2007-10-12 23:54:47 UTC (rev 1035)
+++ mgmt/cumin/bin/cumin-test 2007-10-13 01:40:04 UTC (rev 1036)
@@ -1,8 +1,13 @@
#!/usr/bin/env python
-import sys
-from cumin import CuminServer
+import sys, profile, pstats
+from wooly.devel import BenchmarkHarness
+from wooly.server import WebServer
+from cumin import *
+from cumin.demo import *
+from cumin.model import *
+
def load_args(argv):
args = dict()
key = None
@@ -10,35 +15,48 @@
for arg in sys.argv:
if arg.startswith("--"):
key = arg[2:]
+ args[key] = None
elif key:
args[key] = arg
key = None
- if key:
- args[key] = None
-
return args
-def main(port, debug=True):
- server = CuminServer(port)
+def do_main(port, debug=True, bench=False, demodata=True):
+ model = CuminModel()
- if debug:
- server.enable_debug()
-
- server.run()
+ app = Cumin(model)
-if __name__ == "__main__":
- args = load_args(sys.argv)
+ if demodata:
+ data = DemoData(model)
+ data.load()
+ data.start_updates()
+
+ if debug or bench:
+ app.enable_debug()
+
+ if bench:
+ harness = BenchmarkHarness(app)
+ harness.run()
+ else:
+ server = WebServer(app, port)
+ server.run()
+
+def main(sargs):
+ args = load_args(sargs)
+
+ in_port = int(args.get("port", 9090))
+ in_debug = True
+ in_profile = "profile" in args
+ in_bench = "bench" in args
+ in_demodata = "no-demo-data" not in args
- port = int(args.get("port", 9090))
-
- if "profile" in args:
- import profile, pstats
+ stats_file = "/tmp/cumin-test-stats"
- stats_file = "/tmp/cumin-test-stats"
-
+ if in_profile:
try:
- code = "main(%i, %r)" % (port, False)
+ code = "do_main(%i, %r, %r, %r)" % \
+ (in_port, False, in_bench, in_demodata)
profile.run(code, stats_file)
raise KeyboardInterrupt()
except KeyboardInterrupt:
@@ -48,11 +66,11 @@
stats.sort_stats("time").print_stats(15)
stats.strip_dirs()
-
- #stats.print_callers("interpolate")
- #stats.print_callees("interpolate")
else:
try:
- main(port)
+ do_main(in_port, in_debug, in_bench, in_demodata)
except KeyboardInterrupt:
pass
+
+if __name__ == "__main__":
+ main(sys.argv)
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2007-10-12 23:54:47 UTC (rev 1035)
+++ mgmt/cumin/python/wooly/__init__.py 2007-10-13 01:40:04 UTC (rev 1036)
@@ -2,6 +2,7 @@
from cStringIO import StringIO
from urllib import quote_plus, unquote_plus
from copy import copy
+# XXX use clock instead
from time import time
from datetime import datetime
@@ -325,6 +326,7 @@
def __init__(self, app):
self.app = app
self.sessions = list()
+ self.urls = set()
def add_page(self, page):
if page.parent:
@@ -467,8 +469,13 @@
self.saved_parameters += params
def marshal(self):
- return self.marshal_page() + "?" + self.marshal_url_vars()
+ url = self.marshal_page() + "?" + self.marshal_url_vars()
+ if self.debug:
+ self.app.debug.urls.add(url)
+
+ return url
+
def marshal_page(self):
return self.get_page().name
Modified: mgmt/cumin/python/wooly/devel.py
===================================================================
--- mgmt/cumin/python/wooly/devel.py 2007-10-12 23:54:47 UTC (rev 1035)
+++ mgmt/cumin/python/wooly/devel.py 2007-10-13 01:40:04 UTC (rev 1036)
@@ -1,7 +1,36 @@
import sys, os
+from random import sample
+from time import clock
from wooly import *
+class BenchmarkHarness(object):
+ def __init__(self, app):
+ self.app = app
+
+ def run(self):
+ self.app.debug.urls.add("")
+ count = 0
+
+ while True:
+ url = sample(self.app.debug.urls, 1)[0]
+
+ start = clock()
+
+ session = Session(self.app)
+ session.unmarshal(url)
+
+ page = session.get_page()
+ page.process(session, None)
+
+ html = page.render(session, None)
+
+ bytes = len(html)
+ millis = (clock() - start) * 1000
+ count += 1
+
+ print count, bytes, millis, url
+
class DevelPage(Page):
html = """
<html>
Modified: mgmt/cumin/python/wooly/server.py
===================================================================
--- mgmt/cumin/python/wooly/server.py 2007-10-12 23:54:47 UTC (rev 1035)
+++ mgmt/cumin/python/wooly/server.py 2007-10-13 01:40:04 UTC (rev 1036)
@@ -11,9 +11,6 @@
self.app = app
self.port = port
- def enable_debug(self):
- self.app.enable_debug()
-
def run(self):
server = HTTPServer(("", self.port), self.RequestHandler)
17 years, 2 months
rhmessaging commits: r1035 - in mgmt/cumin: python/wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 19:54:47 -0400 (Fri, 12 Oct 2007)
New Revision: 1035
Modified:
mgmt/cumin/bin/cumin-test
mgmt/cumin/python/wooly/server.py
Log:
Improves cumin-test a little.
Modified: mgmt/cumin/bin/cumin-test
===================================================================
--- mgmt/cumin/bin/cumin-test 2007-10-12 22:50:16 UTC (rev 1034)
+++ mgmt/cumin/bin/cumin-test 2007-10-12 23:54:47 UTC (rev 1035)
@@ -19,6 +19,14 @@
return args
+def main(port, debug=True):
+ server = CuminServer(port)
+
+ if debug:
+ server.enable_debug()
+
+ server.run()
+
if __name__ == "__main__":
args = load_args(sys.argv)
@@ -27,11 +35,14 @@
if "profile" in args:
import profile, pstats
+ stats_file = "/tmp/cumin-test-stats"
+
try:
- profile.run("CuminServer().run()", "cumin-test-stats")
+ code = "main(%i, %r)" % (port, False)
+ profile.run(code, stats_file)
raise KeyboardInterrupt()
except KeyboardInterrupt:
- stats = pstats.Stats("cumin-test-stats")
+ stats = pstats.Stats(stats_file)
stats.sort_stats("cumulative").print_stats(15)
stats.sort_stats("time").print_stats(15)
@@ -41,4 +52,7 @@
#stats.print_callers("interpolate")
#stats.print_callees("interpolate")
else:
- CuminServer(port).run()
+ try:
+ main(port)
+ except KeyboardInterrupt:
+ pass
Modified: mgmt/cumin/python/wooly/server.py
===================================================================
--- mgmt/cumin/python/wooly/server.py 2007-10-12 22:50:16 UTC (rev 1034)
+++ mgmt/cumin/python/wooly/server.py 2007-10-12 23:54:47 UTC (rev 1035)
@@ -11,6 +11,9 @@
self.app = app
self.port = port
+ def enable_debug(self):
+ self.app.enable_debug()
+
def run(self):
server = HTTPServer(("", self.port), self.RequestHandler)
@@ -20,10 +23,7 @@
print "Cumin server started on port %s" % (self.port)
- try:
- server.serve_forever()
- except KeyboardInterrupt:
- pass
+ server.serve_forever()
class RequestHandler(BaseHTTPRequestHandler):
http_date = "%a, %d %b %Y %H:%M:%S %Z"
17 years, 2 months
rhmessaging commits: r1034 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 18:50:16 -0400 (Fri, 12 Oct 2007)
New Revision: 1034
Modified:
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/wooly/__init__.py
mgmt/cumin/python/wooly/devel.py
mgmt/cumin/python/wooly/server.py
Log:
Makes the TabSet use a tab template instead of in-code html.
Disables debug stuff by default.
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-10-12 22:20:26 UTC (rev 1033)
+++ mgmt/cumin/python/cumin/page.py 2007-10-12 22:50:16 UTC (rev 1034)
@@ -34,7 +34,8 @@
self.modal.set(session, modal)
def save_session(self, session):
- self.app.sessions.append(session)
+ if self.app.debug:
+ self.app.debug.sessions.append(session)
def show_server(self, session, server):
cluster = server.get_cluster()
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2007-10-12 22:20:26 UTC (rev 1033)
+++ mgmt/cumin/python/wooly/__init__.py 2007-10-12 22:50:16 UTC (rev 1034)
@@ -106,7 +106,8 @@
def process(self, session, object):
if session.debug:
- call = WidgetCall(session.process_stack, self, session, object)
+ call = WidgetCall(session.debug.process_stack,
+ self, session, object)
call.open()
self.do_process(session, object)
@@ -120,7 +121,8 @@
def render(self, session, object):
if session.debug:
- call = WidgetCall(session.render_stack, self, session, object)
+ call = WidgetCall(session.debug.render_stack,
+ self, session, object)
call.open()
string = self.do_render(session, object)
@@ -314,8 +316,16 @@
self.finder = ResourceFinder()
self.cached_css = None
- self.sessions = list()
+ self.debug = None
+ def enable_debug(self):
+ self.debug = self.Debug(self)
+
+ class Debug(object):
+ def __init__(self, app):
+ self.app = app
+ self.sessions = list()
+
def add_page(self, page):
if page.parent:
raise Exception("Page '%s' is not a root widget" % page.name)
@@ -381,18 +391,24 @@
self.redirect = None
self.saved_parameters = list()
- self.debug = True
+ if self.app.debug:
+ self.debug = self.Debug(self)
+ else:
+ self.debug = None
- self.process_stack = list()
- self.render_stack = list()
+ class Debug(object):
+ def __init__(self, app):
+ self.app = app
+ self.process_stack = list()
+ self.render_stack = list()
- def print_process_calls(self, out=sys.stdout):
- if self.process_stack:
- self.process_stack[0].write(out)
+ def print_process_calls(self, out=sys.stdout):
+ if self.process_stack:
+ self.process_stack[0].write(out)
- def print_render_calls(self, out=sys.stdout):
- if self.render_stack:
- self.render_stack[0].write(out)
+ def print_render_calls(self, out=sys.stdout):
+ if self.render_stack:
+ self.render_stack[0].write(out)
def branch(self):
return Session(self.app, self)
Modified: mgmt/cumin/python/wooly/devel.py
===================================================================
--- mgmt/cumin/python/wooly/devel.py 2007-10-12 22:20:26 UTC (rev 1033)
+++ mgmt/cumin/python/wooly/devel.py 2007-10-12 22:50:16 UTC (rev 1034)
@@ -24,8 +24,8 @@
writer.write("<ul>")
- if self.app.sessions:
- call = self.app.sessions[-1].render_stack[0]
+ if self.app.debug and self.app.debug.sessions:
+ call = self.app.debug.sessions[-1].render_stack[0]
self.render_call(session, call, writer)
writer.write("</ul>")
Modified: mgmt/cumin/python/wooly/server.py
===================================================================
--- mgmt/cumin/python/wooly/server.py 2007-10-12 22:20:26 UTC (rev 1033)
+++ mgmt/cumin/python/wooly/server.py 2007-10-12 22:50:16 UTC (rev 1034)
@@ -107,10 +107,11 @@
self.send_header("Content-Type", "text/plain")
self.end_headers()
- self.wfile.write("APPLICATION ERROR\n")
- self.wfile.write("\n----- python trace -----\n")
- print_exc(None, self.wfile)
- self.wfile.write("\n----- process trace -----\n")
- session.print_process_calls(self.wfile)
- self.wfile.write("\n----- render trace -----\n")
- session.print_render_calls(self.wfile)
+ if session.debug:
+ self.wfile.write("APPLICATION ERROR\n")
+ self.wfile.write("\n----- python trace -----\n")
+ print_exc(None, self.wfile)
+ self.wfile.write("\n----- process trace -----\n")
+ session.debug.print_process_calls(self.wfile)
+ self.wfile.write("\n----- render trace -----\n")
+ session.debug.print_render_calls(self.wfile)
17 years, 2 months
rhmessaging commits: r1033 - in store/trunk/cpp/lib: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: cctrieloff
Date: 2007-10-12 18:20:26 -0400 (Fri, 12 Oct 2007)
New Revision: 1033
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/TxnCtxt.h
store/trunk/cpp/lib/jrnl/deq_rec.hpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
lots of small fixes for txns
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2007-10-12 21:58:53 UTC (rev 1032)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2007-10-12 22:20:26 UTC (rev 1033)
@@ -263,7 +263,7 @@
//recover transactions:
for (txn_list::iterator i = prepared.begin(); i != prepared.end(); i++) {
RecoverableTransaction::shared_ptr dtx =
- registry.recoverTransaction(i->xid, std::auto_ptr<TPCTransactionContext>(new TPCTxnCtxt(i->xid)));
+ registry.recoverTransaction(i->xid, std::auto_ptr<TPCTransactionContext>(new TPCTxnCtxt(i->xid, &messageIdSequence)));
if (i->enqueues.get()) {
for (LockedMappings::iterator j = i->enqueues->begin(); j != i->enqueues->end(); j++) {
dtx->enqueue(queues[j->first], messages[j->second]);
@@ -401,7 +401,10 @@
dtokp.set_wstate(DataTokenImpl::ENQ);
// read the message from the Journal.
try {
- while (read) {
+
+//std::cout << jc->dirname() <<"-queueName:" << queue->getName() << "-enq count:" << jc->get_enq_cnt() << std::endl;
+
+ while (read) {
rhm::journal::iores res = jc->read_data_record(&dbuff, dbuffSize, &xidbuff, xidbuffSize, transientFlag, &dtokp);
readSize = dtokp.dsize();
@@ -540,6 +543,9 @@
std::set<string> prepared;
collectPreparedXids(prepared);
+//std::cout << "prep size:" << prepared.size() << std::endl;
+
+
//when using the async journal, it will abort unprepaired xids and populate the locked maps
if (!usingJrnl()){
txn_lock_map enqueues;
@@ -551,7 +557,7 @@
//abort all known but unprepared xids:
for (std::set<string>::iterator i = known.begin(); i != known.end(); i++) {
if (prepared.find(*i) == prepared.end()) {
- TPCTxnCtxt txn(*i);
+ TPCTxnCtxt txn(*i, NULL);
completed(txn, dequeueXidDb, enqueueXidDb);
}
}
@@ -562,6 +568,8 @@
}
} else {
for (std::set<string>::iterator i = prepared.begin(); i != prepared.end(); i++) {
+
+//std::cout << "prep:" << *i << std::endl;
LockedMappings::shared_ptr enq_ptr;
enq_ptr.reset(new LockedMappings);
LockedMappings::shared_ptr deq_ptr;
@@ -900,8 +908,8 @@
bool written = false;
DataTokenImpl* ddtokp = new DataTokenImpl;
ddtokp->setSourceMessage (&msg);
- ddtokp->set_rid(msg.getPersistenceId()); // message id to be dequeued
- ddtokp->set_dequeue_rid(messageIdSequence.next());
+ ddtokp->set_rid(messageIdSequence.next());
+ ddtokp->set_dequeue_rid(msg.getPersistenceId());
ddtokp->set_wstate(DataTokenImpl::ENQ);
JournalImpl* jc = static_cast<JournalImpl*>(queue.getExternalQueueStore());
string tid;
@@ -921,7 +929,7 @@
}
} catch (rhm::journal::jexception& e) {
std::string str;
- delete ddtokp;
+ //delete ddtokp;
THROW_STORE_EXCEPTION("Error dequeuing message" + e.to_string(str));
}
switch (dres)
@@ -1024,14 +1032,19 @@
auto_ptr<TransactionContext> BdbMessageStore::begin()
{
- TxnCtxt* txn(new TxnCtxt(true));
+ // pass sequence number for c/a when using jrnl
+ TxnCtxt* txn(new TxnCtxt(&messageIdSequence ));
txn->begin(env);
return auto_ptr<TransactionContext>(txn);
}
std::auto_ptr<qpid::broker::TPCTransactionContext> BdbMessageStore::begin(const std::string& xid)
{
- TPCTxnCtxt* txn(new TPCTxnCtxt(xid));
+ IdSequence* jtx = NULL;
+ if (usingJrnl()) jtx = &messageIdSequence;
+
+ // pass sequence number for c/a when using jrnl
+ TPCTxnCtxt* txn(new TPCTxnCtxt(xid, jtx));
txn->begin(env);
return auto_ptr<TPCTransactionContext>(txn);
}
Modified: store/trunk/cpp/lib/TxnCtxt.h
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.h 2007-10-12 21:58:53 UTC (rev 1032)
+++ store/trunk/cpp/lib/TxnCtxt.h 2007-10-12 22:20:26 UTC (rev 1033)
@@ -48,7 +48,7 @@
ipqdef impactedQueues; // list of Queues used in the txn
static unsigned int count;
mutable qpid::sys::Mutex Lock;
- bool loggedtx;
+ IdSequence* loggedtx;
unsigned int getCount() {
qpid::sys::Mutex::ScopedLock locker(Lock);
@@ -63,21 +63,31 @@
void completeTXN(bool commit){
for (TxnCtxt::ipqdef::iterator i = impactedQueues.begin(); i != impactedQueues.end(); i++) {
JournalImpl* jc = static_cast<JournalImpl*>((*i)->getExternalQueueStore());
- if (jc) { /* if using journal */
+ if (jc && loggedtx) { /* if using journal */
DataTokenImpl* dtokp = new DataTokenImpl;
- if (commit)
- jc->txn_commit(dtokp, getXid());
- else
- jc->txn_abort(dtokp, getXid());
- }
+ dtokp->set_rid(loggedtx->next());
+ try{
+ if (commit)
+ jc->txn_commit(dtokp, getXid());
+ else
+ jc->txn_abort(dtokp, getXid());
+
+ } catch (rhm::journal::jexception& e) {
+ std::string str;
+std::cout << "Error commit" << e << std::endl;
+ delete dtokp;
+ THROW_STORE_EXCEPTION("Error commit" + e.to_string(str));
+ }
+
}
+ }
+ sync();
deleteXidRecord();
- sync();
}
public:
- TxnCtxt(bool _loggedtx=false) : loggedtx(_loggedtx), txn(0) {
+ TxnCtxt(IdSequence* _loggedtx=NULL) : loggedtx(_loggedtx), txn(0) {
if (loggedtx) tid = "rhm-tid" + getCount();
}
@@ -94,13 +104,22 @@
allWritten = true;
for (TxnCtxt::ipqdef::iterator i = impactedQueues.begin(); i != impactedQueues.end(); i++) {
JournalImpl* jc = static_cast<JournalImpl*>((*i)->getExternalQueueStore());
- if (jc && !(jc->is_txn_synced(getXid())))
+
+ try
{
- if (firstloop)
- jc->flush();
- allWritten = false;
- jc->get_wr_events();
- }
+ if (jc && !(jc->is_txn_synced(getXid())))
+ {
+ if (firstloop)
+ jc->flush();
+ allWritten = false;
+ jc->get_wr_events();
+ }
+ }catch (rhm::journal::jexception& e) {
+ std::string str;
+std::cout << "Error sync" << e << std::endl;
+
+ THROW_STORE_EXCEPTION("Error sync" + e.to_string(str));
+ }
}
firstloop = false;
}
@@ -108,8 +127,8 @@
virtual ~TxnCtxt() { if(txn) abort(); }
void begin(DbEnv& env){ env.txn_begin(0, &txn, 0); }
- void commit(){ txn->commit(0); completeTXN(true); txn = 0; sync();}
- void abort(){ txn->abort(); completeTXN(false); txn = 0; sync();}
+ void commit(){ txn->commit(0); completeTXN(true); txn = 0; }
+ void abort(){ txn->abort(); completeTXN(false); txn = 0; }
DbTxn* get(){ return txn; }
virtual bool isTPC() { return false; }
virtual const std::string& getXid() { return tid; }
@@ -124,7 +143,7 @@
{
const std::string xid;
public:
- TPCTxnCtxt(const std::string& _xid) : xid(_xid) {}
+ TPCTxnCtxt(const std::string& _xid, IdSequence* _loggedtx) : TxnCtxt(_loggedtx), xid(_xid) {}
virtual bool isTPC() { return true; }
virtual const std::string& getXid() { return xid; }
};
Modified: store/trunk/cpp/lib/jrnl/deq_rec.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/deq_rec.hpp 2007-10-12 21:58:53 UTC (rev 1032)
+++ store/trunk/cpp/lib/jrnl/deq_rec.hpp 2007-10-12 22:20:26 UTC (rev 1033)
@@ -80,6 +80,7 @@
// Decode used for recover
const bool rcv_decode(hdr h, std::ifstream* ifsp, size_t& rec_offs) throw (jexception);
+ inline const u_int64_t rid() const { return _deq_hdr._hdr._rid; }
inline const u_int64_t deq_rid() const { return _deq_hdr._deq_rid; }
const size_t get_xid(void** const xidpp);
std::string& str(std::string& str) const;
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-10-12 21:58:53 UTC (rev 1032)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2007-10-12 22:20:26 UTC (rev 1033)
@@ -367,13 +367,20 @@
{
u_int16_t fid = rd._ffid;
std::ifstream ifs;
- while (rcvr_get_next_record(fid, &ifs, rd, prep_txn_list));
+ while (rcvr_get_next_record(fid, &ifs, rd));
+ std::vector<std::string> xid_list;
+ _tmap.xid_list(xid_list);
+ for (std::vector<std::string>::iterator itr = xid_list.begin(); itr != xid_list.end(); itr++)
+ {
+ std::vector<std::string>::const_iterator pitr = std::find(prep_txn_list.begin(), prep_txn_list.end(), *itr);
+ if (pitr == prep_txn_list.end())
+ _tmap.get_remove_tdata_list(*itr);
+ }
}
}
const bool
-jcntl::rcvr_get_next_record(u_int16_t& fid, std::ifstream* ifsp, rcvdat& rd,
- const std::vector<std::string>& prep_txn_list) throw (jexception)
+jcntl::rcvr_get_next_record(u_int16_t& fid, std::ifstream* ifsp, rcvdat& rd) throw (jexception)
{
size_t cum_size_read = 0;
bool done = false;
@@ -385,24 +392,22 @@
{
case RHM_JDAT_ENQ_MAGIC:
{
-//std::cout << " e" << h._rid << std::flush;
+std::cout << " e" << h._rid << std::flush;
enq_rec er;
while (!done)
{
+std::cout << "*" << std::flush;
done = er.rcv_decode(h, ifsp, cum_size_read);
jfile_cycle(fid, ifsp, rd, false);
}
rd._enq_cnt_list[fid]++;
if (er.xid_size())
{
-//std::cout << "$" << std::flush;
+std::cout << "$" << std::flush;
er.get_xid(&xidp);
assert(xidp != NULL);
std::string xid((char*)xidp, er.xid_size());
- std::vector<std::string>::const_iterator cit = std::find(prep_txn_list.begin(),
- prep_txn_list.end(), xid);
- if (cit != prep_txn_list.end())
- _tmap.insert_txn_data(xid, txn_data(h._rid, fid, true));
+ _tmap.insert_txn_data(xid, txn_data(h._rid, fid, true));
free(xidp);
}
else
@@ -413,26 +418,24 @@
break;
case RHM_JDAT_DEQ_MAGIC:
{
-//std::cout << " d" << h._rid << std::flush;
+std::cout << " d" << h._rid << std::flush;
deq_rec dr;
while (!done)
{
+std::cout << "*" << std::flush;
done = dr.rcv_decode(h, ifsp, cum_size_read);
jfile_cycle(fid, ifsp, rd, false);
}
if (dr.xid_size())
{
-//std::cout << "$" << std::flush;
+std::cout << "$" << std::flush;
// If the enqueue is part of a pending txn, it will not yet be in emap
try { _emap.lock(h._rid); }
catch(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());
- std::vector<std::string>::const_iterator cit = std::find(prep_txn_list.begin(),
- prep_txn_list.end(), xid);
- if (cit != prep_txn_list.end())
- _tmap.insert_txn_data(xid, txn_data(h._rid, fid, false));
+ _tmap.insert_txn_data(xid, txn_data(dr.deq_rid(), fid, false));
free(xidp);
}
else
@@ -454,10 +457,11 @@
break;
case RHM_JDAT_TXA_MAGIC:
{
-//std::cout << " a" << h._rid << std::flush;
+std::cout << " a" << h._rid << std::flush;
txn_rec ar;
while (!done)
{
+std::cout << "*" << std::flush;
done = ar.rcv_decode(h, ifsp, cum_size_read);
jfile_cycle(fid, ifsp, rd, false);
}
@@ -465,22 +469,17 @@
ar.get_xid(&xidp);
assert(xidp != NULL);
std::string xid((char*)xidp, ar.xid_size());
- std::vector<std::string>::const_iterator cit = std::find(prep_txn_list.begin(),
- prep_txn_list.end(), xid);
- if (cit != prep_txn_list.end())
+ txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
+ for (tdl_itr itr = tdl.begin(); itr != tdl.end(); itr++)
{
- txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
- for (tdl_itr itr = tdl.begin(); itr != tdl.end(); itr++)
+ try { _emap.unlock(itr->_rid); }
+ catch(jexception e)
{
- try { _emap.unlock(itr->_rid); }
- catch(jexception e)
- {
- if (e.err_code() != jerrno::JERR_MAP_NOTFOUND)
- throw e;
- }
- if (itr->_enq_flag)
- _wrfc.decr_enqcnt(itr->_fid);
+ if (e.err_code() != jerrno::JERR_MAP_NOTFOUND)
+ throw e;
}
+ if (itr->_enq_flag)
+ _wrfc.decr_enqcnt(itr->_fid);
}
free(xidp);
if (rd._h_rid < h._rid)
@@ -489,10 +488,11 @@
break;
case RHM_JDAT_TXC_MAGIC:
{
-//std::cout << " c" << h._rid << std::flush;
+std::cout << " c" << h._rid << std::flush;
txn_rec cr;
while (!done)
{
+std::cout << "*" << std::flush;
done = cr.rcv_decode(h, ifsp, cum_size_read);
jfile_cycle(fid, ifsp, rd, false);
}
@@ -500,22 +500,20 @@
cr.get_xid(&xidp);
assert(xidp != NULL);
std::string xid((char*)xidp, cr.xid_size());
- std::vector<std::string>::const_iterator cit = std::find(prep_txn_list.begin(),
- prep_txn_list.end(), xid);
- if (cit != prep_txn_list.end())
+std::cout << "@" << std::flush;
+ txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
+ for (tdl_itr itr = tdl.begin(); itr != tdl.end(); itr++)
{
- txn_data_list tdl = _tmap.get_remove_tdata_list(xid);
- for (tdl_itr itr = tdl.begin(); itr != tdl.end(); itr++)
+std::cout << " enq_flag=" << itr->_enq_flag << std::flush;
+ if (itr->_enq_flag) // txn enqueue
+ _emap.insert_fid(itr->_rid, itr->_fid);
+ else // txn dequeue
{
- if (itr->_enq_flag) // txn enqueue
- _emap.insert_fid(itr->_rid, itr->_fid);
- else // txn dequeue
- {
- u_int16_t fid = _emap.get_remove_fid(h._rid, true);
- _wrfc.decr_enqcnt(fid);
- }
+ u_int16_t fid = _emap.get_remove_fid(itr->_rid, true);
+ _wrfc.decr_enqcnt(fid);
}
}
+
free(xidp);
if (rd._h_rid < h._rid)
rd._h_rid = h._rid;
@@ -523,18 +521,18 @@
break;
case RHM_JDAT_EMPTY_MAGIC:
{
-//std::cout << " x" << std::flush;
+std::cout << " x" << std::flush;
u_int32_t rec_dblks = jrec::size_dblks(sizeof(hdr));
ifsp->ignore(rec_dblks * JRNL_DBLK_SIZE - sizeof(hdr));
}
break;
case 0:
-//std::cout << " z" << std::flush;
+std::cout << " z" << std::flush;
rd._lfid = fid;
rd._eo = ifsp->tellg();
return false;
default:
-//std::cout << " ?" << std::flush;
+std::cout << " ?" << std::flush;
std::stringstream ss;
ss << std::hex << std::setfill('0') << "Magic=0x" << std::setw(8) << h._magic;
throw jexception(jerrno::JERR_JCNTL_UNKNOWNMAGIC, ss.str(), "jcntl",
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-10-12 21:58:53 UTC (rev 1032)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2007-10-12 22:20:26 UTC (rev 1033)
@@ -614,8 +614,7 @@
void rcvr_janalyze(rcvdat& rd, const std::vector<std::string>& prep_txn_list)
throw (jexception);
- const bool rcvr_get_next_record(u_int16_t& fid, std::ifstream* ifsp, rcvdat& rd,
- const std::vector<std::string>& prep_txn_list) throw (jexception);
+ const bool rcvr_get_next_record(u_int16_t& fid, std::ifstream* ifsp, rcvdat& rd) throw (jexception);
const bool jfile_cycle(u_int16_t& fid, std::ifstream* ifsp, rcvdat& rd,
const bool jump_fro);
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2007-10-12 21:58:53 UTC (rev 1032)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2007-10-12 22:20:26 UTC (rev 1033)
@@ -263,8 +263,15 @@
}
// TODO: Tidy this up!
- u_int64_t rid = initialize_rid(cont, dtokp);
+// u_int64_t rid = initialize_rid(cont, dtokp);
+// _deq_rec.reset(rid, dtokp->rid(), xid_ptr, xid_len);
+ u_int64_t rid = dtokp->getSourceMessage() ? dtokp->rid() : (cont ? _wrfc.rid() - 1 : _wrfc.get_incr_rid());
u_int64_t dequeue_rid = dtokp->getSourceMessage() ? dtokp->dequeue_rid() : dtokp->rid();
+ if (!dtokp->getSourceMessage())
+ {
+ dtokp->set_rid(rid);
+ dtokp->set_dequeue_rid(dequeue_rid);
+ }
_deq_rec.reset(rid, dequeue_rid, xid_ptr, xid_len);
if (!cont)
{
@@ -303,11 +310,11 @@
try { _emap.lock(rid); }
catch(jexception e) { if (e.err_code() != jerrno::JERR_MAP_NOTFOUND) throw e; }
std::string xid((char*)xid_ptr, xid_len);
- _tmap.insert_txn_data(xid, txn_data(rid, dtokp->fid(), false));
+ _tmap.insert_txn_data(xid, txn_data(dequeue_rid, dtokp->fid(), false));
}
else
{
- u_int16_t fid = _emap.get_remove_fid(dtokp->rid());
+ u_int16_t fid = _emap.get_remove_fid(dtokp->dequeue_rid());
_wrfc.decr_enqcnt(fid);
}
#endif
@@ -399,7 +406,7 @@
else
_abort_busy = true;
- u_int64_t rid = initialize_rid(cont, dtokp);
+ u_int64_t rid = dtokp->rid() ? dtokp->rid() : (cont ? _wrfc.rid() - 1 : _wrfc.get_incr_rid());
_txn_rec.reset(RHM_JDAT_TXA_MAGIC, rid, xid_ptr, xid_len);
if (!cont)
{
@@ -538,7 +545,7 @@
else
_commit_busy = true;
- u_int64_t rid = initialize_rid(cont, dtokp);
+ u_int64_t rid = dtokp->rid() ? dtokp->rid() : (cont ? _wrfc.rid() - 1 : _wrfc.get_incr_rid());
_txn_rec.reset(RHM_JDAT_TXC_MAGIC, rid, xid_ptr, xid_len);
if (!cont)
{
@@ -806,7 +813,7 @@
break;
default:
std::stringstream ss;
- ss << "dtok_state=" << dtp->wstate_str();
+ ss << "dtok_id=" << dtp->id() << "dtok_state=" << dtp->wstate_str();
throw jexception(jerrno::JERR_WMGR_BADDTOKSTATE, ss.str(), "wmgr",
"get_events");
}
17 years, 2 months
rhmessaging commits: r1032 - in mgmt/cumin/python: wooly and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 17:58:53 -0400 (Fri, 12 Oct 2007)
New Revision: 1032
Modified:
mgmt/cumin/python/cumin/widgets.py
mgmt/cumin/python/wooly/__init__.py
Log:
Moves save_parameters from CuminFrame to Frame.
Modified: mgmt/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/cumin/python/cumin/widgets.py 2007-10-12 21:48:58 UTC (rev 1031)
+++ mgmt/cumin/python/cumin/widgets.py 2007-10-12 21:58:53 UTC (rev 1032)
@@ -15,12 +15,6 @@
return "<span class=\"none\">None</span>"
class CuminFrame(Frame, ModeSet):
- def save_parameters(self, session):
- frame = self.page().get_frame(session)
-
- if not frame or self is frame or self in frame.ancestors():
- super(CuminFrame, self).save_parameters(session)
-
def do_process(self, session, object):
self.page().get_frames(session).append(self)
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2007-10-12 21:48:58 UTC (rev 1031)
+++ mgmt/cumin/python/wooly/__init__.py 2007-10-12 21:58:53 UTC (rev 1032)
@@ -288,6 +288,12 @@
if self.object:
return self.object.get(session)
+ def save_parameters(self, session):
+ frame = self.page().get_frame(session)
+
+ if not frame or self is frame or self in frame.ancestors():
+ super(Frame, self).save_parameters(session)
+
def do_process(self, session, object):
new_object = self.get_object(session)
super(Frame, self).do_process(session, new_object)
17 years, 2 months
rhmessaging commits: r1031 - mgmt/cumin/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 17:48:58 -0400 (Fri, 12 Oct 2007)
New Revision: 1031
Modified:
mgmt/cumin/python/wooly/widgets.py
mgmt/cumin/python/wooly/widgets.strings
Log:
Makes TabSet use a child template for rendering tabs.
Modified: mgmt/cumin/python/wooly/widgets.py
===================================================================
--- mgmt/cumin/python/wooly/widgets.py 2007-10-12 21:03:35 UTC (rev 1030)
+++ mgmt/cumin/python/wooly/widgets.py 2007-10-12 21:48:58 UTC (rev 1031)
@@ -44,6 +44,11 @@
def __init__(self, app, name):
super(TabSet, self).__init__(app, name)
+ self.tab_tmpl = Template(self, "tab_html")
+
+ self.object = Attribute(app, "object")
+ self.add_attribute(self.object)
+
def do_render(self, session, object):
writer = Writer()
@@ -51,24 +56,26 @@
return writer.to_string()
- # XXX make this use an item template
def render_tabs(self, session, object):
+ self.object.set(session, object)
writer = Writer()
- str = """<li><a href="%s" class="%s">%s</a></li>"""
for mode in self.children:
- branch = session.branch()
- self.set_selected_mode(branch, mode)
- href = branch.marshal()
+ self.tab_tmpl.render(session, mode, writer)
- smode = self.get_selected_mode(session)
- selected = smode == mode and "selected" or ""
+ return writer.to_string()
- content = mode.render_title(session, object)
+ def render_tab_href(self, session, mode):
+ branch = session.branch()
+ self.set_selected_mode(branch, mode)
+ return branch.marshal()
- writer.write(str % (href, selected, content))
+ def render_tab_class(self, session, mode):
+ smode = self.get_selected_mode(session)
+ return smode == mode and "selected" or ""
- return writer.to_string()
+ def render_tab_content(self, session, mode):
+ return mode.render_title(session, self.object.get(session))
def render_mode(self, session, object):
mode = self.get_selected_mode(session)
Modified: mgmt/cumin/python/wooly/widgets.strings
===================================================================
--- mgmt/cumin/python/wooly/widgets.strings 2007-10-12 21:03:35 UTC (rev 1030)
+++ mgmt/cumin/python/wooly/widgets.strings 2007-10-12 21:48:58 UTC (rev 1031)
@@ -42,6 +42,9 @@
<ul class="TabSet tabs">{tabs}</ul>
<div class="TabSet mode">{mode}</div>
+[TabSet.tab_html]
+<li><a href="{tab_href}" class="{tab_class}">{tab_content}</a></li>
+
[Link.html]
<a href="{href}">{content}</a>
17 years, 2 months
rhmessaging commits: r1030 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 17:03:35 -0400 (Fri, 12 Oct 2007)
New Revision: 1030
Modified:
mgmt/cumin/python/cumin/page.py
mgmt/cumin/python/cumin/virtualhost.py
mgmt/cumin/python/cumin/virtualhost.strings
Log:
Removes the vhost template stuff for now. Adds a config tab to the
vhost view.
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-10-12 20:44:01 UTC (rev 1029)
+++ mgmt/cumin/python/cumin/page.py 2007-10-12 21:03:35 UTC (rev 1030)
@@ -3,7 +3,6 @@
from wooly.widgets import *
from wooly.resources import *
-from virtualhost import *
from server import *
from cluster import *
from widgets import *
@@ -115,9 +114,6 @@
self.view = MainView(app, "view")
self.add_child(self.view)
- self.vhost = VirtualHostTemplateFrame(app, "vhost")
- self.add_child(self.vhost)
-
self.server = ServerFrame(app, "server")
self.add_child(self.server)
Modified: mgmt/cumin/python/cumin/virtualhost.py
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.py 2007-10-12 20:44:01 UTC (rev 1029)
+++ mgmt/cumin/python/cumin/virtualhost.py 2007-10-12 21:03:35 UTC (rev 1030)
@@ -21,11 +21,6 @@
return mlink(branch.marshal(), "VirtualHost", vhost.name)
-class VirtualHostGroupTree(ItemTree):
- def render_title(self, session, model):
- return "Groups (%i)" \
- % len(model.get_virtual_host_groups())
-
class VirtualHostParameter(Parameter):
def do_unmarshal(self, string):
return self.app.model.get_virtual_host(int(string))
@@ -33,9 +28,9 @@
def do_marshal(self, vhost):
return str(vhost.id)
-class BaseVirtualHostFrame(CuminFrame):
+class VirtualHostFrame(CuminFrame):
def __init__(self, app, name):
- super(BaseVirtualHostFrame, self).__init__(app, name)
+ super(VirtualHostFrame, self).__init__(app, name)
self.param = VirtualHostParameter(app, "id")
self.add_parameter(self.param)
@@ -47,60 +42,26 @@
self.exchange = ExchangeFrame(app, "exchange")
self.add_child(self.exchange)
+ self.view = VirtualHostView(app, "view")
+ self.add_child(self.view)
+
def set_virtual_host(self, session, vhost):
return self.param.set(session, vhost)
+ def show_view(self, session):
+ return self.show_mode(session, self.view)
+
def show_queue(self, session, queue):
self.queue.set_queue(session, queue)
-
return self.show_mode(session, self.queue)
def show_exchange(self, session, exchange):
self.exchange.set_exchange(session, exchange)
-
return self.show_mode(session, self.exchange)
-class VirtualHostFrame(BaseVirtualHostFrame):
- def __init__(self, app, name):
- super(VirtualHostFrame, self).__init__(app, name)
-
- self.view = VirtualHostView(app, "view")
- self.add_child(self.view)
-
- def set_virtual_host(self, session, vhost):
- return self.param.set(session, vhost)
-
- def show_view(self, session):
- return self.show_mode(session, self.view)
-
def render_title(self, session, vhost):
return "Functional Host '%s'" % vhost.name
-class VirtualHostTemplateFrame(BaseVirtualHostFrame):
- def __init__(self, app, name):
- super(VirtualHostTemplateFrame, self).__init__(app, name)
-
- self.view = VirtualHostTemplateView(app, "view")
- self.add_child(self.view)
-
- self.queue_add = QueueAdd(app, "queue_add")
- self.add_child(self.queue_add)
-
- self.exchange_add = ExchangeAdd(app, "exchange_add")
- self.add_child(self.exchange_add)
-
- def show_view(self, session):
- return self.show_mode(session, self.view)
-
- def show_queue_add(self, session):
- return self.show_mode(session, self.queue_add)
-
- def show_exchange_add(self, session):
- return self.show_mode(session, self.exchange_add)
-
- def render_title(self, session, vhost):
- return "Host Template '%s'" % vhost.name
-
class VirtualHostView(Widget):
def __init__(self, app, name):
super(VirtualHostView, self).__init__(app, name)
@@ -108,15 +69,11 @@
self.tabs = TabSet(app, "tabs")
self.add_child(self.tabs)
- self.queues = QueueSet(app, "queues")
- self.tabs.add_child(self.queues)
+ self.tabs.add_child(QueueSet(app, "queues"))
+ self.tabs.add_child(ExchangeSet(app, "exchanges"))
+ self.tabs.add_child(self.ConfigTab(app, "config"))
+ self.tabs.add_child(self.LogTab(app, "log"))
- self.exchanges = ExchangeSet(app, "exchanges")
- self.tabs.add_child(self.exchanges)
-
- self.log = self.VirtualHostLog(app, "log")
- self.tabs.add_child(self.log)
-
def render_title(self, session, vhost):
return "Functional Host '%s'" % vhost.name
@@ -145,66 +102,10 @@
else:
return none()
- class VirtualHostLog(Widget):
+ class ConfigTab(Widget):
def render_title(self, session, vhost):
- return "Log Messages"
+ return "Configuration"
-class VirtualHostTemplateView(Widget):
- def __init__(self, app, name):
- super(VirtualHostTemplateView, self).__init__(app, name)
-
- self.tabs = TabSet(app, "tabs")
- self.add_child(self.tabs)
-
- self.queues = self.QueueTab(app, "queues")
- self.tabs.add_child(self.queues)
-
- self.exchanges = self.ExchangeTab(app, "exchanges")
- self.tabs.add_child(self.exchanges)
-
- def render_title(self, session, vhost):
- return "Host Template '%s'" % vhost.name
-
- def render_name(self, session, vhost):
- return vhost.name
-
- def render_add_queue_href(self, session, vhost):
- branch = session.branch()
- self.page().show_virtual_host(branch, vhost).show_queue_add(branch)
- return branch.marshal()
-
- def render_add_exchange_href(self, session, vhost):
- branch = session.branch()
- self.page().show_virtual_host(branch, vhost).show_exchange_add(branch)
- return branch.marshal()
-
- class QueueTab(Widget):
- def __init__(self, app, name):
- super(VirtualHostTemplateView.QueueTab, self).__init__(app, name)
-
- self.queues = QueueSet(app, "queues")
- self.add_child(self.queues)
-
+ class LogTab(Widget):
def render_title(self, session, vhost):
- return self.queues.render_title(session, vhost)
-
- def render_add_queue_href(self, session, vhost):
- branch = session.branch()
- self.page().show_virtual_host(branch, vhost).show_queue_add(branch)
- return branch.marshal()
-
- class ExchangeTab(Widget):
- def __init__(self, app, name):
- super(VirtualHostTemplateView.ExchangeTab, self).__init__(app, name)
-
- self.exchanges = ExchangeSet(app, "exchanges")
- self.add_child(self.exchanges)
-
- def render_title(self, session, vhost):
- return self.exchanges.render_title(session, vhost)
-
- def render_add_exchange_href(self, session, vhost):
- branch = session.branch()
- frame = self.page().show_virtual_host(branch, vhost)
- frame.show_exchange_add(branch)
- return branch.marshal()
+ return "Log Messages"
Modified: mgmt/cumin/python/cumin/virtualhost.strings
===================================================================
--- mgmt/cumin/python/cumin/virtualhost.strings 2007-10-12 20:44:01 UTC (rev 1029)
+++ mgmt/cumin/python/cumin/virtualhost.strings 2007-10-12 21:03:35 UTC (rev 1030)
@@ -27,32 +27,3 @@
{tabs}
</div>
-
-[VirtualHostTemplateView.html]
-<div class="oblock">
- <h1>{title}</h1>
-
- <dl class="properties">
- <dt>Name</dt><dd>{name}</dd>
- </dl>
-
- <ul class="actions">
- <li><a href="">Remove This Template</a></li>
- </ul>
-
- {tabs}
-</div>
-
-[QueueTab.html]
-<ul class="actions">
- <li><a href="{add_queue_href}">Add Queue</a></li>
-</ul>
-
-{queues}
-
-[ExchangeTab.html]
-<ul class="actions">
- <li><a href="{add_exchange_href}">Add Exchange</a></li>
-</ul>
-
-{exchanges}
17 years, 2 months
rhmessaging commits: r1029 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2007-10-12 16:44:01 -0400 (Fri, 12 Oct 2007)
New Revision: 1029
Modified:
mgmt/cumin/python/cumin/page.py
Log:
Removes a duplicate param instance.
Modified: mgmt/cumin/python/cumin/page.py
===================================================================
--- mgmt/cumin/python/cumin/page.py 2007-10-12 19:56:46 UTC (rev 1028)
+++ mgmt/cumin/python/cumin/page.py 2007-10-12 20:44:01 UTC (rev 1029)
@@ -18,9 +18,6 @@
self.frames = self.FramesAttribute(app, "frames")
self.add_attribute(self.frames)
- self.frame = self.FrameParameter(app, "frame")
- self.add_parameter(self.frame)
-
self.modal = Attribute(app, "modal")
self.add_attribute(self.modal)
17 years, 2 months