rhmessaging commits: r1878 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-09 07:52:07 -0400 (Wed, 09 Apr 2008)
New Revision: 1878
Modified:
mgmt/cumin/python/cumin/model.py
Log:
Give the default exchange a special name
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-09 11:46:06 UTC (rev 1877)
+++ mgmt/cumin/python/cumin/model.py 2008-04-09 11:52:07 UTC (rev 1878)
@@ -799,6 +799,14 @@
def get_icon_href(self, session):
return "resource?name=exchange-36.png"
+ def get_object_title(self, session, object):
+ name = self.get_object_name(object)
+
+ if name:
+ return super(CuminExchange, self).get_object_title(session, object)
+ else:
+ return "Default Exchange"
+
class CuminBinding(RemoteClass):
def __init__(self, model):
super(CuminBinding, self).__init__(model, "binding",
18 years
rhmessaging commits: r1877 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-09 07:46:06 -0400 (Wed, 09 Apr 2008)
New Revision: 1877
Modified:
mgmt/cumin/python/cumin/queue.strings
Log:
Remove the heading; we need the room
Modified: mgmt/cumin/python/cumin/queue.strings
===================================================================
--- mgmt/cumin/python/cumin/queue.strings 2008-04-09 11:35:25 UTC (rev 1876)
+++ mgmt/cumin/python/cumin/queue.strings 2008-04-09 11:46:06 UTC (rev 1877)
@@ -80,10 +80,6 @@
[QueueStatus.html]
<div id="{id}" class="{class}">
- <h2>Status</h2>
-
- <!-- <div>{status_info}</div> -->
-
<table>
<tr>
<th></th>
18 years
rhmessaging commits: r1876 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-09 07:35:25 -0400 (Wed, 09 Apr 2008)
New Revision: 1876
Modified:
mgmt/cumin/python/cumin/widgets.strings
Log:
Narrow the scope of the CuminDetails css rule
Modified: mgmt/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/cumin/python/cumin/widgets.strings 2008-04-09 11:29:58 UTC (rev 1875)
+++ mgmt/cumin/python/cumin/widgets.strings 2008-04-09 11:35:25 UTC (rev 1876)
@@ -135,7 +135,7 @@
border-collapse: collapse;
}
-table.CuminDetails td {
+table.CuminDetails > tbody > tr > td {
width: 50%;
padding: 0.5em;
}
18 years
rhmessaging commits: r1875 - mgmt/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2008-04-09 07:29:58 -0400 (Wed, 09 Apr 2008)
New Revision: 1875
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/broker.strings
mgmt/cumin/python/cumin/model.py
Log:
Add a custom details tab to BrokerView so we pick up the props and
actions of both the Broker and BrokerRegistration objects.
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-04-08 21:24:31 UTC (rev 1874)
+++ mgmt/cumin/python/cumin/broker.py 2008-04-09 11:29:58 UTC (rev 1875)
@@ -249,7 +249,8 @@
self.__tabs.add_tab(self.BrokerQueueTab(app, "queues"))
self.__tabs.add_tab(ExchangeSet(app, "exchanges"))
self.__tabs.add_tab(ClientSet(app, "clients"))
- self.__tabs.add_tab(PeerSet(app, "links"))
+ self.__tabs.add_tab(PeerSet(app, "peers"))
+ self.__tabs.add_tab(self.BrokerDetailsTab(app, "details"))
self.__missing = self.BrokerMissing(app, "missing")
self.__body.add_mode(self.__missing)
@@ -273,9 +274,6 @@
data = "model.xml?class=broker;id=%i" % reg.broker.id
return "wooly.setIntervalUpdate('%s', updateBroker, 3000)" % data
- def render_icon_resource(self, session, reg):
- return "broker-36.png"
-
def render_group_links(self, session, reg):
links = list()
@@ -320,6 +318,47 @@
def render_title(self, session, reg):
return "Log Messages"
+ class BrokerDetailsTab(Widget):
+ def __init__(self, app, name):
+ super(BrokerView.BrokerDetailsTab, self).__init__(app, name)
+
+ props = self.Properties(app, "properties")
+ self.add_child(props)
+
+ actions = self.Actions(app, "actions")
+ self.add_child(actions)
+
+ def render_title(self, session):
+ return "Details"
+
+ class Properties(CuminProperties):
+ def do_get_items(self, session, reg):
+ cls = self.app.model.get_class_by_object(reg)
+ props = [(x.get_title(session), x.value(reg))
+ for x in cls.properties]
+
+ if reg.broker:
+ cls = self.app.model.get_class_by_object(reg.broker)
+ props.extend([(x.get_title(session),
+ x.value(reg.broker))
+ for x in cls.properties])
+
+ return props
+
+ class Actions(CuminActions):
+ def do_get_items(self, session, reg):
+ cls = self.app.model.get_class_by_object(reg)
+ acts = [(x.get_href(session, reg), x.get_title(session))
+ for x in cls.actions]
+
+ if reg.broker:
+ cls = self.app.model.get_class_by_object(reg.broker)
+ acts.extend([(x.get_href(session, reg.broker),
+ x.get_title(session))
+ for x in cls.actions])
+
+ return acts
+
class BrokerBrowser(Widget):
def __init__(self, app, name):
super(BrokerBrowser, self).__init__(app, name)
Modified: mgmt/cumin/python/cumin/broker.strings
===================================================================
--- mgmt/cumin/python/cumin/broker.strings 2008-04-08 21:24:31 UTC (rev 1874)
+++ mgmt/cumin/python/cumin/broker.strings 2008-04-09 11:29:58 UTC (rev 1875)
@@ -108,6 +108,18 @@
{items}
+[BrokerDetailsTab.html]
+<table class="CuminDetails">
+ <tr>
+ <th>Properties</th>
+ <th>Actions</th>
+ </tr>
+ <tr>
+ <td>{properties}</td>
+ <td>{actions}</td>
+ </tr>
+</table>
+
[BrokerBrowser.html]
<table class="browser">
<tr>
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-04-08 21:24:31 UTC (rev 1874)
+++ mgmt/cumin/python/cumin/model.py 2008-04-09 11:29:58 UTC (rev 1875)
@@ -381,9 +381,6 @@
def __init__(self, model, name, mint_class):
super(LocalClass, self).__init__(model, name, mint_class)
- action = self.Add(self, "add")
- action.title = "Add"
-
action = self.Edit(self, "edit")
action.title = "Edit"
18 years
rhmessaging commits: r1874 - in store/trunk/cpp/lib: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-08 17:24:31 -0400 (Tue, 08 Apr 2008)
New Revision: 1874
Modified:
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/jrnl/jcntl.hpp
Log:
Fixes to instrumentation - creation of new persistent queues did not show num files and filesize; also no activity on outstanding AIO depth counters.
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-04-08 21:03:59 UTC (rev 1873)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-04-08 21:24:31 UTC (rev 1874)
@@ -99,7 +99,7 @@
const journal::rd_aio_cb rd_cb, const journal::wr_aio_cb wr_cb);
inline void initialize(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks) {
- jcntl::initialize(num_jfiles, jfsize_sblks, 0, &aio_wr_callback);
+ initialize(num_jfiles, jfsize_sblks, 0, &aio_wr_callback);
}
void recover(const u_int16_t num_jfiles, const u_int32_t jfsize_sblks,
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-04-08 21:03:59 UTC (rev 1873)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-04-08 21:24:31 UTC (rev 1874)
@@ -599,8 +599,8 @@
inline u_int32_t unflushed_dblks() { return _wmgr.unflushed_dblks(); }
// Management instrumentation callbacks
- inline void instr_incr_outstanding_aio_cnt() {}
- inline void instr_decr_outstanding_aio_cnt() {}
+ inline virtual void instr_incr_outstanding_aio_cnt() {}
+ inline virtual void instr_decr_outstanding_aio_cnt() {}
18 years
rhmessaging commits: r1873 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-08 17:03:59 -0400 (Tue, 08 Apr 2008)
New Revision: 1873
Modified:
store/trunk/cpp/lib/jrnl/nlfh.cpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
Log:
Yet another F9 fix
Modified: store/trunk/cpp/lib/jrnl/nlfh.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/nlfh.cpp 2008-04-08 20:39:23 UTC (rev 1872)
+++ store/trunk/cpp/lib/jrnl/nlfh.cpp 2008-04-08 21:03:59 UTC (rev 1873)
@@ -32,6 +32,7 @@
#include <jrnl/nlfh.hpp>
#include <cerrno>
+#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <iomanip>
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-04-08 20:39:23 UTC (rev 1872)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-04-08 21:03:59 UTC (rev 1873)
@@ -32,6 +32,7 @@
#include <cassert>
#include <cerrno>
+#include <cstdlib>
#include <jrnl/jcntl.hpp>
#include <jrnl/jerrno.hpp>
#include <sstream>
18 years
rhmessaging commits: r1872 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-08 16:39:23 -0400 (Tue, 08 Apr 2008)
New Revision: 1872
Modified:
store/trunk/cpp/lib/jrnl/jdir.cpp
Log:
Yet another F9 fix
Modified: store/trunk/cpp/lib/jrnl/jdir.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jdir.cpp 2008-04-08 20:25:24 UTC (rev 1871)
+++ store/trunk/cpp/lib/jrnl/jdir.cpp 2008-04-08 20:39:23 UTC (rev 1872)
@@ -31,6 +31,7 @@
#include <jrnl/jdir.hpp>
+#include <cstdlib>
#include <cstring>
#include <dirent.h>
#include <cerrno>
18 years
rhmessaging commits: r1871 - in store/trunk: cpp/lib/gen/qpid/management and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-08 16:25:24 -0400 (Tue, 08 Apr 2008)
New Revision: 1871
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/gen/qpid/management/Journal.cpp
store/trunk/cpp/lib/gen/qpid/management/Journal.h
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
store/trunk/specs/management-schema.xml
Log:
Additional journal management instrumentation: Journal depth (hilo) and Outstanding AIOs (hilo)
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-04-08 20:25:24 UTC (rev 1871)
@@ -257,7 +257,10 @@
handleIoResult(jcntl::enqueue_data_record(data_buff, tot_data_len, this_data_len, dtokp, transient));
if (_mgmtObject.get() != 0)
+ {
_mgmtObject->inc_journalRecordEnqueues();
+ _mgmtObject->inc_journalRecordDepth();
+ }
}
void
@@ -267,7 +270,10 @@
handleIoResult(jcntl::enqueue_extern_data_record(tot_data_len, dtokp, transient));
if (_mgmtObject.get() != 0)
+ {
_mgmtObject->inc_journalRecordEnqueues();
+ _mgmtObject->inc_journalRecordDepth();
+ }
}
void
@@ -277,7 +283,10 @@
handleIoResult(jcntl::enqueue_txn_data_record(data_buff, tot_data_len, this_data_len, dtokp, xid, transient));
if (_mgmtObject.get() != 0)
+ {
_mgmtObject->inc_journalRecordEnqueues();
+ _mgmtObject->inc_journalRecordDepth();
+ }
}
void
@@ -287,7 +296,10 @@
handleIoResult(jcntl::enqueue_extern_txn_data_record(tot_data_len, dtokp, xid, transient));
if (_mgmtObject.get() != 0)
+ {
_mgmtObject->inc_journalRecordEnqueues();
+ _mgmtObject->inc_journalRecordDepth();
+ }
}
void
@@ -296,7 +308,10 @@
handleIoResult(jcntl::dequeue_data_record(dtokp));
if (_mgmtObject.get() != 0)
+ {
_mgmtObject->inc_journalRecordDequeues();
+ _mgmtObject->dec_journalRecordDepth();
+ }
}
void
@@ -305,7 +320,10 @@
handleIoResult(jcntl::dequeue_txn_data_record(dtokp, xid));
if (_mgmtObject.get() != 0)
+ {
_mgmtObject->inc_journalRecordDequeues();
+ _mgmtObject->dec_journalRecordDepth();
+ }
}
void
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-04-08 20:25:24 UTC (rev 1871)
@@ -177,6 +177,14 @@
}
static void aio_wr_callback(jcntl* journal, std::vector<journal::data_tok*>& dtokl);
// static void aio_rd_callback(jcntl* journal, std::vector<u_int16_t>& pil);
+
+ // Management instrumentation callbacks overridden from jcntl
+ inline void instr_incr_outstanding_aio_cnt() {
+ if (_mgmtObject.get() != 0) _mgmtObject->inc_journalOutstandingAIOs();
+ }
+ inline void instr_decr_outstanding_aio_cnt() {
+ if (_mgmtObject.get() != 0) _mgmtObject->dec_journalOutstandingAIOs();
+ }
}; // class JournalImpl
} // namespace bdbstore
Modified: store/trunk/cpp/lib/gen/qpid/management/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Journal.cpp 2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/gen/qpid/management/Journal.cpp 2008-04-08 20:25:24 UTC (rev 1871)
@@ -37,7 +37,7 @@
string Journal::packageName = string ("mrgstore");
string Journal::className = string ("journal");
uint8_t Journal::md5Sum[16] =
- {0x59,0x12,0x32,0xe1,0x16,0x75,0xbe,0x3,0xf,0x2,0x6,0x82,0x84,0xd5,0xf,0x52};
+ {0x7f,0x89,0x7d,0x90,0xac,0xec,0x28,0xb2,0x5a,0xe3,0x4a,0xea,0xf4,0x79,0xee,0xbe};
Journal::Journal (Manageable* _core) :
ManagementObject(_core)
@@ -52,6 +52,9 @@
journalRecordDepthLow = 0;
journalRecordEnqueues = 0;
journalRecordDequeues = 0;
+ journalOutstandingAIOs = 0;
+ journalOutstandingAIOsHigh = 0;
+ journalOutstandingAIOsLow = 0;
journalFreeFileCount = 0;
journalFreeFileCountHigh = 0;
journalFreeFileCountLow = 0;
@@ -98,7 +101,7 @@
buf.putShortString (className); // Class Name
buf.putBin128 (md5Sum); // Schema Hash
buf.putShort (7); // Config Element Count
- buf.putShort (24); // Inst Element Count
+ buf.putShort (27); // Inst Element Count
buf.putShort (2); // Method Count
buf.putShort (0); // Event Count
@@ -221,6 +224,27 @@
buf.put (ft);
ft = FieldTable ();
+ ft.setString (NAME, "journalOutstandingAIOs");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of outstanding AIO requests in Async IO system");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalOutstandingAIOsHigh");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of outstanding AIO requests in Async IO system (High)");
+ buf.put (ft);
+
+ ft = FieldTable ();
+ ft.setString (NAME, "journalOutstandingAIOsLow");
+ ft.setInt (TYPE, TYPE_U32);
+ ft.setString (UNIT, "record");
+ ft.setString (DESC, "Number of outstanding AIO requests in Async IO system (Low)");
+ buf.put (ft);
+
+ ft = FieldTable ();
ft.setString (NAME, "journalFreeFileCount");
ft.setInt (TYPE, TYPE_U32);
ft.setString (UNIT, "file");
@@ -403,6 +427,9 @@
buf.putLong (journalRecordDepthLow);
buf.putLongLong (journalRecordEnqueues);
buf.putLongLong (journalRecordDequeues);
+ buf.putLong (journalOutstandingAIOs);
+ buf.putLong (journalOutstandingAIOsHigh);
+ buf.putLong (journalOutstandingAIOsLow);
buf.putLong (journalFreeFileCount);
buf.putLong (journalFreeFileCountHigh);
buf.putLong (journalFreeFileCountLow);
@@ -424,6 +451,8 @@
// Maintenance of hi-lo statistics
journalRecordDepthHigh = journalRecordDepth;
journalRecordDepthLow = journalRecordDepth;
+ journalOutstandingAIOsHigh = journalOutstandingAIOs;
+ journalOutstandingAIOsLow = journalOutstandingAIOs;
journalFreeFileCountHigh = journalFreeFileCount;
journalFreeFileCountLow = journalFreeFileCount;
journalAvailableFileCountHigh = journalAvailableFileCount;
Modified: store/trunk/cpp/lib/gen/qpid/management/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Journal.h 2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/gen/qpid/management/Journal.h 2008-04-08 20:25:24 UTC (rev 1871)
@@ -56,6 +56,9 @@
uint32_t journalRecordDepthLow;
uint64_t journalRecordEnqueues;
uint64_t journalRecordDequeues;
+ uint32_t journalOutstandingAIOs;
+ uint32_t journalOutstandingAIOsHigh;
+ uint32_t journalOutstandingAIOsLow;
uint32_t journalFreeFileCount;
uint32_t journalFreeFileCountHigh;
uint32_t journalFreeFileCountLow;
@@ -185,6 +188,20 @@
journalRecordDequeues -= by;
instChanged = true;
}
+ inline void inc_journalOutstandingAIOs (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalOutstandingAIOs += by;
+ if (journalOutstandingAIOsHigh < journalOutstandingAIOs)
+ journalOutstandingAIOsHigh = journalOutstandingAIOs;
+ instChanged = true;
+ }
+ inline void dec_journalOutstandingAIOs (uint32_t by = 1){
+ sys::RWlock::ScopedWlock writeLock (accessLock);
+ journalOutstandingAIOs -= by;
+ if (journalOutstandingAIOsLow > journalOutstandingAIOs)
+ journalOutstandingAIOsLow = journalOutstandingAIOs;
+ instChanged = true;
+ }
inline void inc_journalFreeFileCount (uint32_t by = 1){
sys::RWlock::ScopedWlock writeLock (accessLock);
journalFreeFileCount += by;
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-04-08 20:25:24 UTC (rev 1871)
@@ -598,8 +598,12 @@
void chk_wr_frot();
inline u_int32_t unflushed_dblks() { return _wmgr.unflushed_dblks(); }
+ // Management instrumentation callbacks
+ inline void instr_incr_outstanding_aio_cnt() {}
+ inline void instr_decr_outstanding_aio_cnt() {}
+
protected:
/**
* \brief Check status of journal before allowing write operations.
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-08 20:25:24 UTC (rev 1871)
@@ -726,6 +726,7 @@
_wrfc.incr_aio_cnt();
_aio_evt_rem++;
_cached_offset_dblks = 0;
+ _jc->instr_incr_outstanding_aio_cnt();
rotate_page(); // increments _pg_index, resets _pg_offset_dblks if req'd
if (_page_cb_arr[_pg_index]._state == UNUSED)
@@ -868,6 +869,7 @@
// Use stored pointer to nlfh in the pcb instead.
pcbp->_wfh->add_wr_cmpl_cnt_dblks(pcbp->_wdblks);
pcbp->_wfh->decr_aio_cnt();
+ _jc->instr_decr_outstanding_aio_cnt();
// Clean up this pcb's data_tok list
pcbp->_pdtokl->clear();
Modified: store/trunk/specs/management-schema.xml
===================================================================
--- store/trunk/specs/management-schema.xml 2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/specs/management-schema.xml 2008-04-08 20:25:24 UTC (rev 1871)
@@ -26,6 +26,7 @@
<instElement name="journalRecordDepth" type="hilo32" unit="record" desc="Number of enqueued records (durable messages)"/>
<instElement name="journalRecordEnqueues" type="count64" unit="record" desc="Total enqueued records on journal"/>
<instElement name="journalRecordDequeues" type="count64" unit="record" desc="Total dequeued records on journal"/>
+ <instElement name="journalOutstandingAIOs" type="hilo32" unit="record" desc="Number of outstanding AIO requests in Async IO system"/>
<!--
The following are not yet "wired up" in JournalImpl.cpp
18 years
rhmessaging commits: r1870 - store/trunk/cpp/lib/jrnl.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-04-08 15:48:21 -0400 (Tue, 08 Apr 2008)
New Revision: 1870
Modified:
store/trunk/cpp/lib/jrnl/cvar.hpp
store/trunk/cpp/lib/jrnl/slock.hpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
Log:
Further F9 cleanup
Modified: store/trunk/cpp/lib/jrnl/cvar.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/cvar.hpp 2008-04-08 19:36:30 UTC (rev 1869)
+++ store/trunk/cpp/lib/jrnl/cvar.hpp 2008-04-08 19:48:21 UTC (rev 1870)
@@ -30,6 +30,7 @@
#ifndef rhm_journal_cvar_hpp
#define rhm_journal_cvar_hpp
+#include <cstring>
#include <jrnl/jerrno.hpp>
#include <jrnl/jexception.hpp>
#include <jrnl/time_ns.hpp>
Modified: store/trunk/cpp/lib/jrnl/slock.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/slock.hpp 2008-04-08 19:36:30 UTC (rev 1869)
+++ store/trunk/cpp/lib/jrnl/slock.hpp 2008-04-08 19:48:21 UTC (rev 1870)
@@ -32,6 +32,7 @@
#define rhm_journal_slock_hpp
#include <cerrno>
+#include <cstring>
#include <jrnl/jerrno.hpp>
#include <jrnl/jexception.hpp>
#include <pthread.h>
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-08 19:36:30 UTC (rev 1869)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-04-08 19:48:21 UTC (rev 1870)
@@ -33,6 +33,7 @@
#include <cassert>
#include <cerrno>
#include <cstdlib>
+#include <cstring>
#include <jrnl/file_hdr.hpp>
#include <jrnl/jcntl.hpp>
#include <jrnl/jerrno.hpp>
18 years
rhmessaging commits: r1869 - in store/trunk/cpp: tests and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2008-04-08 15:36:30 -0400 (Tue, 08 Apr 2008)
New Revision: 1869
Modified:
store/trunk/cpp/lib/BdbMessageStore.cpp
store/trunk/cpp/lib/BdbMessageStore.h
store/trunk/cpp/tests/SimpleTest.cpp
Log:
Use updated create interface from QPID to carry arguments for journal creation
Modified: store/trunk/cpp/lib/BdbMessageStore.cpp
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.cpp 2008-04-08 18:48:17 UTC (rev 1868)
+++ store/trunk/cpp/lib/BdbMessageStore.cpp 2008-04-08 19:36:30 UTC (rev 1869)
@@ -268,7 +268,7 @@
}
}
-void BdbMessageStore::create(PersistableQueue& queue)
+void BdbMessageStore::create(PersistableQueue& queue, const FieldTable& args)
{
checkInit();
if (queue.getPersistenceId()) {
@@ -276,16 +276,32 @@
}
if (usingJrnl()) {
JournalImpl* jQueue = 0;
+ FieldTable::ValuePtr value;
+
+ uint16_t localFileCount = numJrnlFiles;
+ uint32_t localFileSize = jrnlFsizePgs;
+
+ value = args.get ("qpid.file_count");
+ if (value.get() != 0 && !value->empty() && value->convertsTo<int>())
+ localFileCount = (uint16_t) value->get<int>();
+
+ value = args.get ("qpid.file_size");
+ if (value.get() != 0 && !value->empty() && value->convertsTo<int>())
+ localFileSize = (uint32_t) value->get<int>();
+
{
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue), string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout);
+ jQueue = new JournalImpl(queue.getName(), getJrnlDir(queue),
+ string("JournalData"), defJournalGetEventsTimeout,
+ defJournalFlushTimeout);
}
queue.setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
try {
// init will create the deque's for the init...
- jQueue->initialize(numJrnlFiles, jrnlFsizePgs * JRNL_RMGR_PAGE_SIZE);
+ jQueue->initialize(localFileCount, localFileSize * JRNL_RMGR_PAGE_SIZE);
} catch (const journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ": create() failed: " + e.what());
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() +
+ ": create() failed: " + e.what());
}
}
@@ -312,7 +328,7 @@
}
}
-void BdbMessageStore::create(const PersistableExchange& exchange)
+void BdbMessageStore::create(const PersistableExchange& exchange, const FieldTable& /*args*/)
{
checkInit();
if (exchange.getPersistenceId()) {
Modified: store/trunk/cpp/lib/BdbMessageStore.h
===================================================================
--- store/trunk/cpp/lib/BdbMessageStore.h 2008-04-08 18:48:17 UTC (rev 1868)
+++ store/trunk/cpp/lib/BdbMessageStore.h 2008-04-08 19:36:30 UTC (rev 1869)
@@ -169,10 +169,12 @@
void truncate();
- void create(qpid::broker::PersistableQueue& queue);
+ void create(qpid::broker::PersistableQueue& queue,
+ const qpid::framing::FieldTable& args);
void destroy(qpid::broker::PersistableQueue& queue);
- void create(const qpid::broker::PersistableExchange& queue);
+ void create(const qpid::broker::PersistableExchange& queue,
+ const qpid::framing::FieldTable& args);
void destroy(const qpid::broker::PersistableExchange& queue);
void bind(const qpid::broker::PersistableExchange& exchange,
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2008-04-08 18:48:17 UTC (rev 1868)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2008-04-08 19:36:30 UTC (rev 1869)
@@ -33,6 +33,7 @@
#include <qpid/broker/Queue.h>
#include <qpid/broker/RecoveryManagerImpl.h>
#include <qpid/framing/AMQHeaderBody.h>
+#include <qpid/framing/FieldTable.h>
#define TESTDIR "/tmp"
@@ -86,7 +87,7 @@
store.truncate();//make sure it is empty to begin with
string name("CreateDeleteQueue");
Queue queue(name, 0, &store, 0);
- store.create(queue);
+ store.create(queue, qpid::framing::FieldTable());
// TODO - check dir exists
BOOST_REQUIRE(queue.getPersistenceId());
store.destroy(queue);
@@ -114,7 +115,7 @@
store.init(TESTDIR, async, true, 4, 1);
store.truncate();//make sure it is empty to begin with
Queue queue(name, 0, &store, 0);
- store.create(queue);
+ store.create(queue, qpid::framing::FieldTable());
BOOST_REQUIRE(queue.getPersistenceId());
id = queue.getPersistenceId();
}//db will be closed
@@ -166,7 +167,7 @@
store.init(TESTDIR, async, true, 4, 1);
store.truncate();//make sure it is empty to begin with
Queue queue(name, 0, &store, 0);
- store.create(queue);
+ store.create(queue, qpid::framing::FieldTable());
store.destroy(queue);
}//db will be closed
{
@@ -407,7 +408,7 @@
MessageUtils::addContent(msg, data);
Queue queue("my_queue", 0, &store, 0);
- store.create(queue);
+ store.create(queue, qpid::framing::FieldTable());
store.enqueue(0, pmsg, queue);
store.destroy(*pmsg);
@@ -433,7 +434,7 @@
store.truncate();//make sure it is empty to begin with
ExchangeRegistry registry;
Exchange::shared_ptr exchange = registry.declare(name, type, true, args).first;
- store.create(*exchange);
+ store.create(*exchange, qpid::framing::FieldTable());
id = exchange->getPersistenceId();
BOOST_REQUIRE(id);
}//db will be closed
@@ -476,8 +477,8 @@
store.truncate();//make sure it is empty to begin with
Exchange::shared_ptr exchange(new DirectExchange(exchangeName, true, args));
Queue::shared_ptr queue(new Queue(queueName, 0, &store, 0));
- store.create(*exchange);
- store.create(*queue);
+ store.create(*exchange, qpid::framing::FieldTable());
+ store.create(*queue, qpid::framing::FieldTable());
BOOST_REQUIRE(exchange->bind(queue, key, &args));
store.bind(*exchange, *queue, key, args);
}//db will be closed
@@ -537,9 +538,9 @@
Exchange::shared_ptr exchange(new DirectExchange(exchangeName, true, args));
Queue::shared_ptr queue1(new Queue(queueName1, 0, &store, 0));
Queue::shared_ptr queue2(new Queue(queueName2, 0, &store, 0));
- store.create(*exchange);
- store.create(*queue1);
- store.create(*queue2);
+ store.create(*exchange, qpid::framing::FieldTable());
+ store.create(*queue1, qpid::framing::FieldTable());
+ store.create(*queue2, qpid::framing::FieldTable());
store.bind(*exchange, *queue1, key, args);
store.bind(*exchange, *queue2, key, args);
//delete queue1:
18 years