rhmessaging commits: r2910 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-02 17:26:27 -0500 (Tue, 02 Dec 2008)
New Revision: 2910
Modified:
mgmt/trunk/cumin/python/cumin/pool.py
Log:
Default Show All button correctly
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2008-12-02 21:50:54 UTC (rev 2909)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2008-12-02 22:26:27 UTC (rev 2910)
@@ -436,7 +436,6 @@
self.add_state("a", "All")
self.add_state("m", "Machine")
- self.param.default = "m"
def render_href(self, session):
state = self.get(session)
17 years, 4 months
rhmessaging commits: r2909 - in mgmt/trunk/cumin: resources and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-02 16:50:54 -0500 (Tue, 02 Dec 2008)
New Revision: 2909
Added:
mgmt/trunk/cumin/resources/job-20.png
mgmt/trunk/cumin/resources/job-36.png
Modified:
mgmt/trunk/cumin/python/cumin/job.strings
mgmt/trunk/cumin/resources/cluster-20.png
mgmt/trunk/cumin/resources/cluster-36.png
Log:
New cluster and job icons
Modified: mgmt/trunk/cumin/python/cumin/job.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.strings 2008-12-02 21:29:00 UTC (rev 2908)
+++ mgmt/trunk/cumin/python/cumin/job.strings 2008-12-02 21:50:54 UTC (rev 2909)
@@ -399,3 +399,14 @@
}
}
}
+
+[JobView.html]
+<script type="text/javascript">
+{script}
+</script>
+
+{status}
+<h1><img src="resource?name=job-36.png" alt="job" />{title}</h1>
+{summary}
+{tabs}
+
Modified: mgmt/trunk/cumin/resources/cluster-20.png
===================================================================
(Binary files differ)
Modified: mgmt/trunk/cumin/resources/cluster-36.png
===================================================================
(Binary files differ)
Added: mgmt/trunk/cumin/resources/job-20.png
===================================================================
(Binary files differ)
Property changes on: mgmt/trunk/cumin/resources/job-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: mgmt/trunk/cumin/resources/job-36.png
===================================================================
(Binary files differ)
Property changes on: mgmt/trunk/cumin/resources/job-36.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months
rhmessaging commits: r2908 - in store/trunk/cpp: lib/jrnl and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2008-12-02 16:29:00 -0500 (Tue, 02 Dec 2008)
New Revision: 2908
Added:
store/trunk/cpp/lib/jrnl/aio_callback.hpp
Removed:
store/trunk/cpp/lib/jrnl/aio_cb.hpp
Modified:
store/trunk/cpp/lib/JournalImpl.cpp
store/trunk/cpp/lib/JournalImpl.h
store/trunk/cpp/lib/Makefile.am
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
store/trunk/cpp/lib/jrnl/pmgr.cpp
store/trunk/cpp/lib/jrnl/pmgr.hpp
store/trunk/cpp/lib/jrnl/rmgr.cpp
store/trunk/cpp/lib/jrnl/rmgr.hpp
store/trunk/cpp/lib/jrnl/wmgr.cpp
store/trunk/cpp/lib/jrnl/wmgr.hpp
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp
store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.hpp
Log:
Fix for BZ 472928 - "Enqueue completion lost/not signalled if queue is deleted". A reorganization in an attempt to fix the bug which removes the C-style static function call for callbacks and replaces it with a more c++-styled object pointer, and which did not affect the problem is retained.
Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/JournalImpl.cpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -101,7 +101,7 @@
JournalImpl::~JournalImpl()
{
if (_init_flag && !_stop_flag){
- try { stop(true); }
+ try { stop(true); } // NOTE: This will *block* until all outstanding disk aio calls are complete!
catch (const jexception& e) { log(LOG_ERROR, e.what()); }
}
(dynamic_cast<GetEventsFireEvent*>(getEventsFireEventsPtr.get()))->cancel();
@@ -129,16 +129,14 @@
const u_int32_t jfsize_sblks,
const u_int16_t wcache_num_pages,
const u_int32_t wcache_pgsize_sblks,
- const journal::rd_aio_cb rd_cb,
- const journal::wr_aio_cb wr_cb)
+ journal::aio_callback* const cbp)
{
std::ostringstream oss;
oss << "Initialize; num_jfiles=" << num_jfiles << " jfsize_sblks=" << jfsize_sblks;
oss << " wcache_pgsize_sblks=" << wcache_pgsize_sblks;
oss << " wcache_num_pages=" << wcache_num_pages;
log(LOG_DEBUG, oss.str());
- jcntl::initialize(num_jfiles, auto_expand, ae_max_jfiles, jfsize_sblks, wcache_num_pages, wcache_pgsize_sblks,
- rd_cb, wr_cb);
+ jcntl::initialize(num_jfiles, auto_expand, ae_max_jfiles, jfsize_sblks, wcache_num_pages, wcache_pgsize_sblks, cbp);
log(LOG_DEBUG, "Initialization complete");
if (_mgmtObject != 0)
@@ -158,8 +156,7 @@
const u_int32_t jfsize_sblks,
const u_int16_t wcache_num_pages,
const u_int32_t wcache_pgsize_sblks,
- const journal::rd_aio_cb rd_cb,
- const journal::wr_aio_cb wr_cb,
+ journal::aio_callback* const cbp,
boost::ptr_list<msgstore::PreparedTransaction>* prep_tx_list_ptr,
u_int64_t& highest_rid,
u_int64_t queue_id)
@@ -188,10 +185,10 @@
}
jcntl::recover(num_jfiles, auto_expand, ae_max_jfiles, jfsize_sblks, wcache_num_pages, wcache_pgsize_sblks,
- rd_cb, wr_cb, &prep_xid_list, highest_rid);
+ cbp, &prep_xid_list, highest_rid);
} else {
jcntl::recover(num_jfiles, auto_expand, ae_max_jfiles, jfsize_sblks, wcache_num_pages, wcache_pgsize_sblks,
- rd_cb, wr_cb, 0, highest_rid);
+ cbp, 0, highest_rid);
}
// Populate PreparedTransaction lists from _tmap
@@ -482,6 +479,37 @@
}
void
+JournalImpl::wr_aio_cb(std::vector<data_tok*>& dtokl)
+{
+ for (std::vector<data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
+ {
+ DataTokenImpl* dtokp = static_cast<DataTokenImpl*>(*i);
+ if (/*!is_stopped() &&*/ dtokp->getSourceMessage())
+ {
+ switch (dtokp->wstate())
+ {
+ case data_tok::ENQ:
+ dtokp->getSourceMessage()->enqueueComplete();
+ break;
+ case data_tok::DEQ:
+/* Don't need to signal until we have a way to ack completion of dequeue in AMQP
+ dtokp->getSourceMessage()->dequeueComplete();
+ if ( dtokp->getSourceMessage()->isDequeueComplete() ) // clear id after last dequeue
+ dtokp->getSourceMessage()->setPersistenceId(0);
+*/
+ break;
+ default: ;
+ }
+ }
+ dtokp->release();
+ }
+}
+
+void
+JournalImpl::rd_aio_cb(std::vector<u_int16_t>& /*pil*/)
+{}
+
+void
JournalImpl::free_read_buffers()
{
if (_xidp) {
@@ -526,36 +554,6 @@
}
}
-// static AIO callback fns
-
-void
-JournalImpl::aio_wr_callback(jcntl* journal, std::vector<data_tok*>& dtokl)
-{
- for (std::vector<data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
- {
- DataTokenImpl* dtokp = static_cast<DataTokenImpl*>(*i);
- if (!journal->is_stopped() && dtokp->getSourceMessage())
- {
- switch (dtokp->wstate())
- {
- case data_tok::ENQ:
- dtokp->getSourceMessage()->enqueueComplete();
- break;
- case data_tok::DEQ:
-/* Don't need to signal until we have a way to ack completion of dequeue in AMQP
- dtokp->getSourceMessage()->dequeueComplete();
- if ( dtokp->getSourceMessage()->isDequeueComplete() ) // clear id after last dequeue
- dtokp->getSourceMessage()->setPersistenceId(0);
-*/
- break;
- default:
- ;
- }
- }
- dtokp->release();
- }
-}
-
qpid::management::Manageable::status_t JournalImpl::ManagementMethod (uint32_t methodId,
qpid::management::Args& /*args*/,
std::string& /*text*/)
@@ -575,7 +573,3 @@
return status;
}
-
-// void
-// JournalImpl::aio_rd_callback(jcntl* /*journal*/, std::vector<u_int16_t>& /*pil*/)
-// {}
Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/JournalImpl.h 2008-12-02 21:29:00 UTC (rev 2908)
@@ -25,6 +25,7 @@
#define _JournalImpl_
#include <set>
+#include "jrnl/data_tok.hpp"
#include "jrnl/jcntl.hpp"
#include "jrnl/slock.hpp"
#include "DataTokenImpl.h"
@@ -68,7 +69,7 @@
inline void cancel() { mrg::journal::slock s(&_gefe_mutex); parent = 0; }
};
- class JournalImpl : public qpid::broker::ExternalQueueStore, public journal::jcntl
+ class JournalImpl : public qpid::broker::ExternalQueueStore, public journal::jcntl, public journal::aio_callback
{
private:
static qpid::broker::Timer* journalTimerPtr;
@@ -107,8 +108,7 @@
const u_int32_t jfsize_sblks,
const u_int16_t wcache_num_pages,
const u_int32_t wcache_pgsize_sblks,
- const journal::rd_aio_cb rd_cb,
- const journal::wr_aio_cb wr_cb);
+ journal::aio_callback* const cbp);
inline void initialize(const u_int16_t num_jfiles,
const bool auto_expand,
@@ -117,7 +117,7 @@
const u_int16_t wcache_num_pages,
const u_int32_t wcache_pgsize_sblks) {
initialize(num_jfiles, auto_expand, ae_max_jfiles, jfsize_sblks, wcache_num_pages, wcache_pgsize_sblks,
- 0, &aio_wr_callback);
+ this);
}
void recover(const u_int16_t num_jfiles,
@@ -126,8 +126,7 @@
const u_int32_t jfsize_sblks,
const u_int16_t wcache_num_pages,
const u_int32_t wcache_pgsize_sblks,
- const journal::rd_aio_cb rd_cb,
- const journal::wr_aio_cb wr_cb,
+ journal::aio_callback* const cbp,
boost::ptr_list<msgstore::PreparedTransaction>* prep_tx_list_ptr,
u_int64_t& highest_rid,
u_int64_t queue_id);
@@ -142,7 +141,7 @@
u_int64_t& highest_rid,
u_int64_t queue_id) {
recover(num_jfiles, auto_expand, ae_max_jfiles, jfsize_sblks, wcache_num_pages, wcache_pgsize_sblks,
- 0, &aio_wr_callback, prep_tx_list_ptr, highest_rid, queue_id);
+ this, prep_tx_list_ptr, highest_rid, queue_id);
}
void recover_complete();
@@ -188,6 +187,10 @@
void getEventsFire();
void flushFire();
+ // AIO callbacks
+ void wr_aio_cb(std::vector<journal::data_tok*>& dtokl);
+ void rd_aio_cb(std::vector<u_int16_t>& pil);
+
qpid::management::ManagementObject* GetManagementObject (void) const
{ return _mgmtObject; }
@@ -206,9 +209,6 @@
}
void handleIoResult(const journal::iores r);
- 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 != 0) _mgmtObject->inc_outstandingAIOs();
Modified: store/trunk/cpp/lib/Makefile.am
===================================================================
--- store/trunk/cpp/lib/Makefile.am 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/Makefile.am 2008-12-02 21:29:00 UTC (rev 2908)
@@ -68,7 +68,7 @@
jrnl/wmgr.cpp \
jrnl/wrfc.cpp \
jrnl/aio.hpp \
- jrnl/aio_cb.hpp \
+ jrnl/aio_callback.hpp \
jrnl/arr_cnt.hpp \
jrnl/cvar.hpp \
jrnl/data_tok.hpp \
Added: store/trunk/cpp/lib/jrnl/aio_callback.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/aio_callback.hpp (rev 0)
+++ store/trunk/cpp/lib/jrnl/aio_callback.hpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -0,0 +1,55 @@
+/**
+* \file aio_callback.hpp
+*
+* Red Hat Messaging - Message Journal
+*
+* This file contains the definition for the AIO callback function
+* pointer.
+*
+* Copyright 2007, 2008 Red Hat, Inc.
+*
+* This file is part of Red Hat Messaging.
+*
+* Red Hat Messaging is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or (at your option) any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+* USA
+*
+* The GNU Lesser General Public License is available in the file COPYING.
+*/
+
+#ifndef mrg_journal_aio_callback_hpp
+#define mrg_journal_aio_callback_hpp
+
+#include <vector>
+#include <sys/types.h>
+
+namespace mrg
+{
+namespace journal
+{
+
+ class data_tok;
+
+ class aio_callback
+ {
+ public:
+ virtual void wr_aio_cb(std::vector<data_tok*>& dtokl) = 0;
+ virtual void rd_aio_cb(std::vector<u_int16_t>& pil) = 0;
+
+ };
+
+} // namespace journal
+} // namespace mrg
+
+#endif // ifndef mrg_journal_aio_callback_hpp
Deleted: store/trunk/cpp/lib/jrnl/aio_cb.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/aio_cb.hpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/aio_cb.hpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -1,53 +0,0 @@
-/**
-* \file aio_cb.hpp
-*
-* Red Hat Messaging - Message Journal
-*
-* This file contains the definition for the AIO callback function
-* pointer.
-*
-* Copyright 2007, 2008 Red Hat, Inc.
-*
-* This file is part of Red Hat Messaging.
-*
-* Red Hat Messaging is free software; you can redistribute it and/or
-* modify it under the terms of the GNU Lesser General Public
-* License as published by the Free Software Foundation; either
-* version 2.1 of the License, or (at your option) any later version.
-*
-* This library is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this library; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-* USA
-*
-* The GNU Lesser General Public License is available in the file COPYING.
-*/
-
-#ifndef mrg_journal_aio_cb_hpp
-#define mrg_journal_aio_cb_hpp
-
-#include <vector>
-#include <sys/types.h>
-
-namespace mrg
-{
-namespace journal
-{
-
- class jcntl;
- class data_tok;
-
- /**
- * \brief Callback function pointer to be called when AIO events arrive.
- */
- typedef void (*wr_aio_cb)(jcntl* journal, std::vector<data_tok*>& dtokl);
- typedef void (*rd_aio_cb)(jcntl* journal, std::vector<u_int16_t>& pil);
-} // namespace journal
-} // namespace mrg
-
-#endif // ifndef mrg_journal_aio_cb_hpp
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -89,7 +89,7 @@
void
jcntl::initialize(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles,
const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
- const rd_aio_cb rd_cb, const wr_aio_cb wr_cb)
+ aio_callback* const cbp)
{
_init_flag = false;
_stop_flag = false;
@@ -117,9 +117,8 @@
_wrfc.initialize(_jfsize_sblks);
_rrfc.initialize();
_rrfc.set_findex(0);
- _rmgr.initialize(rd_cb);
- _wmgr.initialize(wr_cb, wcache_pgsize_sblks, wcache_num_pages, JRNL_WMGR_MAXDTOKPP,
- JRNL_WMGR_MAXWAITUS);
+ _rmgr.initialize(cbp);
+ _wmgr.initialize(cbp, wcache_pgsize_sblks, wcache_num_pages, JRNL_WMGR_MAXDTOKPP, JRNL_WMGR_MAXWAITUS);
// Write info file (<basename>.jinf) to disk
write_infofile();
@@ -130,7 +129,8 @@
void
jcntl::recover(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles,
const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
- const rd_aio_cb rd_cb, const wr_aio_cb wr_cb, const std::vector<std::string>* prep_txn_list_ptr,
+// const rd_aio_cb rd_cb, const wr_aio_cb wr_cb, const std::vector<std::string>* prep_txn_list_ptr,
+ aio_callback* const cbp, const std::vector<std::string>* prep_txn_list_ptr,
u_int64_t& highest_rid)
{
_init_flag = false;
@@ -163,8 +163,8 @@
_wrfc.initialize(_jfsize_sblks, &_rcvdat);
_rrfc.initialize();
_rrfc.set_findex(_rcvdat.ffid());
- _rmgr.initialize(rd_cb);
- _wmgr.initialize(wr_cb, wcache_pgsize_sblks, wcache_num_pages, JRNL_WMGR_MAXDTOKPP, JRNL_WMGR_MAXWAITUS,
+ _rmgr.initialize(cbp);
+ _wmgr.initialize(cbp, wcache_pgsize_sblks, wcache_num_pages, JRNL_WMGR_MAXDTOKPP, JRNL_WMGR_MAXWAITUS,
(_rcvdat._lffull ? 0 : _rcvdat._eo));
_readonly_flag = true;
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -191,14 +191,13 @@
* \param jfsize_sblks The size of each journal file expressed in softblocks.
* \param wcache_num_pages The number of write cache pages to create.
* \param wcache_pgsize_sblks The size in sblks of each write cache page.
- * \param rd_cb Function pointer to callback function for read operations. May be 0 (NULL).
- * \param wr_cb Function pointer to callback function for write operations. May be 0 (NULL).
+ * \param cbp Pointer to object containing callback functions for read and write operations. May be 0 (NULL).
*
* \exception TODO
*/
void initialize(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles,
const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
- const rd_aio_cb rd_cb, const wr_aio_cb wr_cb);
+ aio_callback* const cbp);
/**
* /brief Initialize journal by recovering state from previously written journal.
@@ -227,8 +226,7 @@
* \param jfsize_sblks The size of each journal file expressed in softblocks.
* \param wcache_num_pages The number of write cache pages to create.
* \param wcache_pgsize_sblks The size in sblks of each write cache page.
- * \param rd_cb Function pointer to callback function for read operations. May be 0 (NULL).
- * \param wr_cb Function pointer to callback function for write operations. May be 0 (NULL).
+ * \param cbp Pointer to object containing callback functions for read and write operations. May be 0 (NULL).
* \param prep_txn_list_ptr
* \param highest_rid Returns the highest rid found in the journal during recover
*
@@ -236,8 +234,7 @@
*/
void recover(const u_int16_t num_jfiles, const bool auto_expand, const u_int16_t ae_max_jfiles,
const u_int32_t jfsize_sblks, const u_int16_t wcache_num_pages, const u_int32_t wcache_pgsize_sblks,
- const rd_aio_cb rd_cb, const wr_aio_cb wr_cb, const std::vector<std::string>* prep_txn_list_ptr,
- u_int64_t& highest_rid);
+ aio_callback* const cbp, const std::vector<std::string>* prep_txn_list_ptr, u_int64_t& highest_rid);
/**
* \brief Notification to the journal that recovery is complete and that normal operation
Modified: store/trunk/cpp/lib/jrnl/pmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/pmgr.cpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/pmgr.cpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -90,6 +90,7 @@
_pg_cntr(0),
_pg_offset_dblks(0),
_aio_evt_rem(0),
+ _cbp(0),
_enq_rec(),
_deq_rec(),
_txn_rec()
@@ -101,7 +102,7 @@
}
void
-pmgr::initialize(const u_int32_t cache_pgsize_sblks, const u_int16_t cache_num_pages)
+pmgr::initialize(aio_callback* const cbp, const u_int32_t cache_pgsize_sblks, const u_int16_t cache_num_pages)
{
// As static use of this class keeps old values around, clean up first...
pmgr::clean();
@@ -111,6 +112,7 @@
_aio_evt_rem = 0;
_cache_pgsize_sblks = cache_pgsize_sblks;
_cache_num_pages = cache_num_pages;
+ _cbp = cbp;
// 1. Allocate page memory (as a single block)
std::size_t cache_pgsize = _cache_num_pages * _cache_pgsize_sblks * _sblksize;
Modified: store/trunk/cpp/lib/jrnl/pmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/pmgr.hpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/pmgr.hpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -42,6 +42,7 @@
#include <deque>
#include "jrnl/aio.hpp"
+#include "jrnl/aio_callback.hpp"
#include "jrnl/data_tok.hpp"
#include "jrnl/deq_rec.hpp"
#include "jrnl/enq_map.hpp"
@@ -110,6 +111,7 @@
u_int32_t _pg_cntr; ///< Page counter; determines if file rotation req'd
u_int32_t _pg_offset_dblks; ///< Page offset (used so far) in data blocks
u_int32_t _aio_evt_rem; ///< Remaining AIO events
+ aio_callback* _cbp; ///< Pointer to callback object
enq_rec _enq_rec; ///< Enqueue record used for encoding/decoding
deq_rec _deq_rec; ///< Dequeue record used for encoding/decoding
@@ -126,8 +128,8 @@
inline u_int16_t cache_num_pages() const { return _cache_num_pages; }
protected:
- virtual void initialize(const u_int32_t cache_pgsize_sblks,
- const u_int16_t cache_num_pages);
+ virtual void initialize(aio_callback* const cbp, const u_int32_t cache_pgsize_sblks,
+ const u_int16_t cache_num_pages);
virtual void rotate_page() = 0;
virtual void clean();
};
Modified: store/trunk/cpp/lib/jrnl/rmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/rmgr.cpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -57,10 +57,9 @@
}
void
-rmgr::initialize(const rd_aio_cb rd_cb)
+rmgr::initialize(aio_callback* const cbp)
{
- _cb = rd_cb;
- initialize();
+ pmgr::initialize(cbp, JRNL_RMGR_PAGE_SIZE, JRNL_RMGR_PAGES);
clean();
// Allocate memory for reading file header
if (::posix_memalign(&_fhdr_buffer, _sblksize, _sblksize))
@@ -318,8 +317,8 @@
}
// Perform AIO return callback
- if (_cb && ret)
- (_cb)(_jc, pil);
+ if (_cbp && ret)
+ _cbp->rd_aio_cb(pil);
return ret;
}
@@ -365,12 +364,6 @@
_pg_offset_dblks = 0;
}
-void
-rmgr::initialize()
-{
- pmgr::initialize(JRNL_RMGR_PAGE_SIZE, JRNL_RMGR_PAGES);
-}
-
iores
rmgr::pre_read_check(data_tok* dtokp)
{
Modified: store/trunk/cpp/lib/jrnl/rmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/rmgr.hpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/rmgr.hpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -40,7 +40,6 @@
}
#include <cstring>
-#include "jrnl/aio_cb.hpp"
#include "jrnl/enums.hpp"
#include "jrnl/file_hdr.hpp"
#include "jrnl/pmgr.hpp"
@@ -63,7 +62,6 @@
private:
rrfc& _rrfc; ///< Ref to read rotating file controller
rec_hdr _hdr; ///< Header used to determind record type
- rd_aio_cb _cb; ///< Callback function pointer for AIO events
void* _fhdr_buffer; ///< Buffer used for fhdr reads
aio_cb* _fhdr_aio_cb_ptr; ///< iocb pointer for fhdr reads
@@ -74,7 +72,7 @@
rmgr(jcntl* jc, enq_map& emap, txn_map& tmap, rrfc& rrfc);
virtual ~rmgr();
- void initialize(const rd_aio_cb rd_cb);
+ void initialize(aio_callback* const cbp);
iores read(void** const datapp, std::size_t& dsize, void** const xidpp,
std::size_t& xidsize, bool& transient, bool& external, data_tok* dtokp,
bool ignore_pending_txns);
@@ -90,7 +88,6 @@
*/
private:
- void initialize();
void clean();
void init_validation();
iores pre_read_check(data_tok* dtokp);
Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -89,7 +89,7 @@
}
void
-wmgr::initialize(const wr_aio_cb wr_cb, const u_int32_t wcache_pgsize_sblks,
+wmgr::initialize(aio_callback* const cbp, const u_int32_t wcache_pgsize_sblks,
const u_int16_t wcache_num_pages, const u_int32_t max_dtokpp, const u_int32_t max_iowait_us,
std::size_t eo)
{
@@ -99,9 +99,8 @@
_commit_busy = false;
_max_dtokpp = max_dtokpp;
_max_io_wait_us = max_iowait_us;
- _cb = wr_cb;
- initialize(wcache_pgsize_sblks, wcache_num_pages);
+ initialize(cbp, wcache_pgsize_sblks, wcache_num_pages);
_jfsize_dblks = _jc->jfsize_sblks() * JRNL_SBLK_SIZE;
_jfsize_pgs = _jc->jfsize_sblks() / _cache_pgsize_sblks;
@@ -866,8 +865,8 @@
pcbp->_state = state;
// Perform AIO return callback
- if (_cb && tot_data_toks)
- (_cb)(_jc, dtokl);
+ if (_cbp && tot_data_toks)
+ _cbp->wr_aio_cb(dtokl);
}
else // File header writes have no pcb
{
@@ -901,9 +900,9 @@
}
void
-wmgr::initialize(const u_int32_t wcache_pgsize_sblks, const u_int16_t wcache_num_pages)
+wmgr::initialize(aio_callback* const cbp, const u_int32_t wcache_pgsize_sblks, const u_int16_t wcache_num_pages)
{
- pmgr::initialize(wcache_pgsize_sblks, wcache_num_pages);
+ pmgr::initialize(cbp, wcache_pgsize_sblks, wcache_num_pages);
wmgr::clean();
_num_jfiles = _jc->num_jfiles();
if (::posix_memalign(&_fhdr_base_ptr, _sblksize, _sblksize * _num_jfiles))
Modified: store/trunk/cpp/lib/jrnl/wmgr.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.hpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/lib/jrnl/wmgr.hpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -40,7 +40,6 @@
}
#include <cstring>
-#include "jrnl/aio_cb.hpp"
#include "jrnl/enums.hpp"
#include "jrnl/pmgr.hpp"
#include "jrnl/wrfc.hpp"
@@ -96,7 +95,6 @@
deq_rec _deq_rec; ///< Dequeue record used for encoding/decoding
txn_rec _txn_rec; ///< Transaction record used for encoding/decoding
std::set<std::string> _txn_pending_set; ///< Set containing xids of pending commits/aborts
- wr_aio_cb _cb; ///< Callback function pointer for AIO events
public:
wmgr(jcntl* jc, enq_map& emap, txn_map& tmap, wrfc& wrfc);
@@ -104,7 +102,7 @@
const u_int32_t max_iowait_us);
virtual ~wmgr();
- void initialize(wr_aio_cb wr_cb, const u_int32_t wcache_pgsize_sblks,
+ void initialize(aio_callback* const cbp, const u_int32_t wcache_pgsize_sblks,
const u_int16_t wcache_num_pages, const u_int32_t max_dtokpp,
const u_int32_t max_iowait_us, std::size_t eo = 0);
iores enqueue(const void* const data_buff, const std::size_t tot_data_len,
@@ -125,7 +123,8 @@
const std::string status_str() const;
private:
- void initialize(const u_int32_t wcache_pgsize_sblks, const u_int16_t wcache_num_pages);
+ void initialize(aio_callback* const cbp, const u_int32_t wcache_pgsize_sblks,
+ const u_int16_t wcache_num_pages);
iores pre_write_check(const _op_type op, const data_tok* const dtokp,
const std::size_t xidsize = 0, const std::size_t dsize = 0, const bool external = false)
const;
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -61,7 +61,7 @@
bool done() { if (flag || _wstate == NONE) return true; else { flag = true; return false; } }
};
-class test_jrnl : public jcntl
+class test_jrnl : public jcntl, public aio_callback
{
public:
test_jrnl(const std::string& jid, const std::string& jdir, const std::string& base_filename) :
@@ -70,16 +70,15 @@
void initialize(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles,
const u_int32_t jfsize_sblks)
{
- jcntl::initialize(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE, 0,
- &aio_wr_callback);
+ jcntl::initialize(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE,
+ this);
_jdir.create_dir();
}
void recover(const u_int16_t num_jfiles, const bool ae, const u_int16_t ae_max_jfiles, const u_int32_t jfsize_sblks,
vector<string>* txn_list, u_int64_t& highest_rid)
- { jcntl::recover(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE, 0,
- &aio_wr_callback, txn_list, highest_rid); }
-private:
- static void aio_wr_callback(jcntl*, std::vector<data_tok*>& dtokl)
+ { jcntl::recover(num_jfiles, ae, ae_max_jfiles, jfsize_sblks, JRNL_WMGR_DEF_PAGES, JRNL_WMGR_DEF_PAGE_SIZE, this,
+ txn_list, highest_rid); }
+ void wr_aio_cb(std::vector<data_tok*>& dtokl)
{
for (std::vector<data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
{
@@ -88,6 +87,7 @@
delete dtp;
}
}
+ void rd_aio_cb(std::vector<u_int16_t>& /*pil*/) {}
};
/*
Modified: store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.cpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -112,7 +112,7 @@
{
u_int64_t highest_rid;
recover(_jpp->num_jfiles(), _jpp->is_ae(), _jpp->ae_max_jfiles(), _jpp->jfsize_sblks(),
- _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), aio_rd_callback, aio_wr_callback,
+ _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), this,
0, highest_rid);
recover_complete();
}
@@ -120,14 +120,14 @@
{
if (e.err_code() == mrg::journal::jerrno::JERR_JDIR_STAT)
initialize(_jpp->num_jfiles(), _jpp->is_ae(), _jpp->ae_max_jfiles(), _jpp->jfsize_sblks(),
- _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), aio_rd_callback, aio_wr_callback);
+ _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), this);
else
throw;
}
}
else
initialize(_jpp->num_jfiles(), _jpp->is_ae(), _jpp->ae_max_jfiles(), _jpp->jfsize_sblks(),
- _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), aio_rd_callback, aio_wr_callback);
+ _jpp->wcache_num_pages(), _jpp->wcache_pgsize_sblks(), this);
}
catch (const mrg::journal::jexception& e) { _tcrp->add_exception(e); }
catch (const std::exception& e) { _tcrp->add_exception(e.what()); }
@@ -412,20 +412,45 @@
_deq_list_cv.broadcast();
}
-// static AIO callback fns
+// AIO callbacks
void
-jrnl_instance::aio_rd_callback(jcntl* journal, std::vector<u_int16_t>& /*pil*/)
+jrnl_instance::wr_aio_cb(std::vector<journal::data_tok*>& dtokl)
{
- jrnl_instance::handle_rd_callback(journal);
+ for (std::vector<journal::data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
+ {
+ if ((*i)->wstate() == journal::data_tok::ENQ || (*i)->wstate() == journal::data_tok::DEQ)
+ {
+ journal::data_tok* dtokp = *i;
+ if (dtokp->wstate() == journal::data_tok::ENQ)
+ {
+ if (_args_ptr->read_mode.val() == read_arg::NONE)
+ {
+ mrg::journal::slock sl(&_deq_list_mutex);
+ _dtok_deq_list.push_back(dtokp);
+ _deq_list_cv.broadcast();
+ }
+ else
+ {
+ mrg::journal::slock sl(&_rd_list_mutex);
+ _dtok_rd_list.push_back(dtokp);
+ _rd_list_cv.broadcast();
+ }
+ }
+ else // DEQ
+ {
+ mrg::journal::slock sl(&_wr_full_mutex);
+ _wr_full_cv.broadcast();
+ }
+ }
+ }
}
void
-jrnl_instance::aio_wr_callback(jcntl* journal, std::vector<journal::data_tok*>& dtokl)
+jrnl_instance::rd_aio_cb(std::vector<u_int16_t>& /*pil*/)
{
- for (std::vector<journal::data_tok*>::const_iterator i=dtokl.begin(); i!=dtokl.end(); i++)
- if ((*i)->wstate() == journal::data_tok::ENQ || (*i)->wstate() == journal::data_tok::DEQ)
- jrnl_instance::handle_wr_callback(journal, *i);
+ mrg::journal::slock sl(&_rd_aio_mutex);
+ _rd_aio_cv.broadcast();
}
} // namespace jtt
Modified: store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.hpp 2008-12-02 20:44:34 UTC (rev 2907)
+++ store/trunk/cpp/tests/jrnl/jtt/jrnl_instance.hpp 2008-12-02 21:29:00 UTC (rev 2908)
@@ -41,7 +41,7 @@
namespace jtt
{
- class jrnl_instance : public mrg::journal::jcntl
+ class jrnl_instance : public mrg::journal::jcntl, public mrg::journal::aio_callback
{
public:
typedef boost::shared_ptr<jrnl_instance> shared_ptr;
@@ -87,41 +87,11 @@
void run_tc() throw ();
void tc_wait_compl() throw ();
- private:
- inline void handle_rd_callback()
- {
- mrg::journal::slock sl(&_rd_aio_mutex);
- _rd_aio_cv.broadcast();
- }
- static inline void handle_rd_callback(jcntl* jp)
- { static_cast<jrnl_instance*>(jp)->handle_rd_callback(); }
+ // AIO callbacks
+ void wr_aio_cb(std::vector<journal::data_tok*>& dtokl);
+ void rd_aio_cb(std::vector<u_int16_t>& pil);
- inline void handle_wr_callback(mrg::journal::data_tok* dtokp)
- {
- if (dtokp->wstate() == journal::data_tok::ENQ)
- {
- if (_args_ptr->read_mode.val() == read_arg::NONE)
- {
- mrg::journal::slock sl(&_deq_list_mutex);
- _dtok_deq_list.push_back(dtokp);
- _deq_list_cv.broadcast();
- }
- else
- {
- mrg::journal::slock sl(&_rd_list_mutex);
- _dtok_rd_list.push_back(dtokp);
- _rd_list_cv.broadcast();
- }
- }
- else // DEQ
- {
- mrg::journal::slock sl(&_wr_full_mutex);
- _wr_full_cv.broadcast();
- }
- }
- static inline void handle_wr_callback(jcntl* jp, mrg::journal::data_tok* dtokp)
- { static_cast<jrnl_instance*>(jp)->handle_wr_callback(dtokp); }
-
+ private:
void run_enq() throw ();
inline static void* run_enq(void* p)
{ static_cast<jrnl_instance*>(p)->run_enq(); return 0; }
@@ -141,9 +111,9 @@
void panic();
- // static callbacks
- static void aio_rd_callback(jcntl* journal, std::vector<u_int16_t>& pil);
- static void aio_wr_callback(jcntl* journal, std::vector<journal::data_tok*>& dtokl);
+// // static callbacks
+// static void aio_rd_callback(jcntl* journal, std::vector<u_int16_t>& pil);
+// static void aio_wr_callback(jcntl* journal, std::vector<journal::data_tok*>& dtokl);
};
} // namespace jtt
17 years, 4 months
rhmessaging commits: r2907 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-02 15:44:34 -0500 (Tue, 02 Dec 2008)
New Revision: 2907
Modified:
mgmt/trunk/cumin/python/cumin/pool.py
mgmt/trunk/cumin/python/cumin/pool.strings
mgmt/trunk/cumin/python/cumin/widgets.strings
Log:
Switch from radio buttons to a button/link for Slot visualization.
Modified: mgmt/trunk/cumin/python/cumin/pool.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.py 2008-12-02 19:06:47 UTC (rev 2906)
+++ mgmt/trunk/cumin/python/cumin/pool.py 2008-12-02 20:44:34 UTC (rev 2907)
@@ -307,7 +307,7 @@
self.machine_param = Parameter(app, "machine_param")
self.add_parameter(self.machine_param)
- self.show_all_slots = self.SlotSwitch(app, "show_all_slots")
+ self.show_all_slots = self.ShowAllSlots(app, "show_all_slots")
self.add_child(self.show_all_slots)
def process(self, session):
@@ -430,19 +430,27 @@
action = self.app.model.pool.machines
return action.get_field_tuples(session)
- class SlotSwitch(StateSwitch):
+ class ShowAllSlots(StateSwitch):
def __init__(self, app, name):
- super(PoolStats.SlotSwitch, self).__init__(app, name)
+ super(PoolStats.ShowAllSlots, self).__init__(app, name)
- self.add_state("a", "All Slots in Pool", hover="Show all slots in this pool")
- self.add_state("m", "Slots for This Machine", hover="Show slots in this machine only")
+ self.add_state("a", "All")
+ self.add_state("m", "Machine")
self.param.default = "m"
- def render(self, session):
- if self.parent.slot_grid.get_machine(session):
- if self.parent.all_fits.get(session):
- return super(PoolStats.SlotSwitch, self).render(session)
-
+ def render_href(self, session):
+ state = self.get(session)
+ if state == "m":
+ branch = session.branch()
+ self.set(branch, "a")
+ return branch.marshal()
+ else:
+ return "#"
+
+ def render_class(self, session):
+ state = self.get(session)
+ return state == "a" and "disabled" or "enabled"
+
class PoolStatSet(StatSet):
def render_rate_text(self, session, args):
return "Percentage"
Modified: mgmt/trunk/cumin/python/cumin/pool.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/pool.strings 2008-12-02 19:06:47 UTC (rev 2906)
+++ mgmt/trunk/cumin/python/cumin/pool.strings 2008-12-02 20:44:34 UTC (rev 2907)
@@ -47,7 +47,7 @@
div.vistats ul.radiotabs {
margin: 1em 0 0 1em;
}
-div.machine_help {
+.machine_help {
color: #444;
font-size: 0.8em;
}
@@ -77,11 +77,10 @@
</script>
[ShowAllSlots.html]
- <ul class="actions" style="margin: 1em;">
+ <ul class="actions {class}" style="margin: 1em;">
<li><a class="nav" href="{href}">Show All Slots</a></li>
</ul>
-
[MachineVisualization.javascript]
function got_machine_grid(obj, id) {
for (var cell in obj.machines.machine) {
Modified: mgmt/trunk/cumin/python/cumin/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/widgets.strings 2008-12-02 19:06:47 UTC (rev 2906)
+++ mgmt/trunk/cumin/python/cumin/widgets.strings 2008-12-02 20:44:34 UTC (rev 2907)
@@ -76,7 +76,16 @@
ul.actions li {
display: inline;
}
+ul.actions.disabled a {
+ color: #666666;
+}
+ul.actions.disabled li a.nav:before {
+ color: #666666;
+}
+ul.actions.disabled a:hover {
+ background-color: #f7f7f7;
+}
a.nav:before {
content: "\00BB \0020";
font-weight: bold;
17 years, 4 months
rhmessaging commits: r2906 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-02 14:06:47 -0500 (Tue, 02 Dec 2008)
New Revision: 2906
Modified:
mgmt/trunk/cumin/python/cumin/stat.py
mgmt/trunk/cumin/python/cumin/stat.strings
Log:
Don't use borders, margin, or background images if the number of columns in a visualization grid is more than 15
Modified: mgmt/trunk/cumin/python/cumin/stat.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.py 2008-12-02 17:03:00 UTC (rev 2905)
+++ mgmt/trunk/cumin/python/cumin/stat.py 2008-12-02 19:06:47 UTC (rev 2906)
@@ -153,9 +153,10 @@
ajax = self.Updater(app, "grid_updater")
self.add_child(ajax)
- self.ems = 480.0
+ self.max_px = 480.0
self.max_item_em = 28.0
self.max_columns = 20.0
+ self.max_background_cols = 15 # max columns with background image
def render_title(self, session):
return "Utilization"
@@ -168,20 +169,27 @@
columns = self.cells.calculate_columns(count)
return columns <= self.max_columns
+ def get_cell_class(self, session):
+ count = len(self.cells.get_items(session))
+ columns = self.cells.calculate_columns(count)
+ return columns > self.max_background_cols and "small" or "big"
+
def get_grid_width(self, session):
count = len(self.cells.get_items(session))
columns = self.cells.calculate_columns(count)
# we have approx 15em to work with
# we'd like each column to be between 1em and 2em
width = float(columns) * self.max_item_em
- if width > self.ems:
- width = self.ems
+ if width > self.max_px:
+ width = self.max_px
extra = 3.0 * columns # left right border plus 1 right margin
- return width + extra
+ if columns > self.max_background_cols:
+ extra = 0
+ return int(width + extra)
def render_grid_width(self, session):
width = self.get_grid_width(session)
- return "%fpx" % width
+ return "%ipx" % int(width)
class GridCells(ItemSet):
def __init__(self, app, name):
@@ -206,6 +214,9 @@
def render_cell_width(self, session, cell):
return self.width.get(session)
+ def render_cell_class(self, session, cell):
+ return self.parent.get_cell_class(session)
+
def calculate_columns(self, count):
sq = sqrt(count)
isq = int(sq)
@@ -217,9 +228,9 @@
columns = self.calculate_columns(count)
width = self.parent.max_item_em
if columns:
- min = self.parent.ems / float(columns)
+ min = self.parent.max_px / float(columns)
width = min > self.parent.max_item_em and self.parent.max_item_em or min
- return "%fpx" % width
+ return "%ipx" % int(width)
def render_href(self, session, cell):
return self.parent.get_href(session, cell)
Modified: mgmt/trunk/cumin/python/cumin/stat.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/stat.strings 2008-12-02 17:03:00 UTC (rev 2905)
+++ mgmt/trunk/cumin/python/cumin/stat.strings 2008-12-02 19:06:47 UTC (rev 2906)
@@ -226,6 +226,13 @@
position: relative;
color: black;
}
+div.StatGrid a.small {
+ float:left;
+ position: relative;
+ color: black;
+}
+div.StatGrid a.small:hover { border: 0px; }
+
div.StatGrid a:hover { border: 1px solid #a00; }
.btn.yellow { background: #ffc; }
.btn.green { background: #cfc; }
@@ -304,7 +311,7 @@
{items}
[GridCells.item_html]
- <a href="{href}">
+ <a class="{cell_class}" href="{href}">
<div id="button_{cell_id}" class="btn {color}" style="width:{cell_width}; height:{cell_width};">
{contents}
</div>
17 years, 4 months
rhmessaging commits: r2905 - in mgmt/trunk: mint/python/mint and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-12-02 12:03:00 -0500 (Tue, 02 Dec 2008)
New Revision: 2905
Modified:
mgmt/trunk/cumin/python/cumin/__init__.py
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/mint/python/mint/tools.py
Log:
rename dbexpire-* config params / command-line args to expire-*
Modified: mgmt/trunk/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/__init__.py 2008-12-02 16:54:29 UTC (rev 2904)
+++ mgmt/trunk/cumin/python/cumin/__init__.py 2008-12-02 17:03:00 UTC (rev 2905)
@@ -167,10 +167,10 @@
param = ConfigParameter(self, "user", str)
- param = ConfigParameter(self, "dbexpire-frequency", int)
+ param = ConfigParameter(self, "expire-frequency", int)
param.default = 600 # 10 minutes
- param = ConfigParameter(self, "dbexpire-threshold", int)
+ param = ConfigParameter(self, "expire-threshold", int)
param.default = 24 * 3600 # 1 day
def init(self):
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-12-02 16:54:29 UTC (rev 2904)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-12-02 17:03:00 UTC (rev 2905)
@@ -20,8 +20,8 @@
class CuminModel(object):
def __init__(self, app, data_uri):
self.app = app
- self.data = MintModel(data_uri, dbExpireFrequency=app.config.dbexpire_frequency, \
- dbExpireThreshold=app.config.dbexpire_threshold, debug=False)
+ self.data = MintModel(data_uri, dbExpireFrequency=app.config.expire_frequency, \
+ dbExpireThreshold=app.config.expire_threshold, debug=False)
self.classes = list()
self.invocations = set()
Modified: mgmt/trunk/mint/python/mint/tools.py
===================================================================
--- mgmt/trunk/mint/python/mint/tools.py 2008-12-02 16:54:29 UTC (rev 2904)
+++ mgmt/trunk/mint/python/mint/tools.py 2008-12-02 17:03:00 UTC (rev 2905)
@@ -26,13 +26,13 @@
opt = CommandOption(self, "debug")
opt.description = "Enable debugging; print logging to console"
- opt = CommandOption(self, "dbexpire-frequency")
+ opt = CommandOption(self, "expire-frequency")
opt.argument = "FREQUENCY"
- opt.description = "Frequency (in seconds) of the database expiration thread"
+ opt.description = "Frequency (in seconds) of the expiration thread"
- opt = CommandOption(self, "dbexpire-threshold")
+ opt = CommandOption(self, "expire-threshold")
opt.argument = "THRESHOLD"
- opt.description = "Threshold (in seconds) of the age of database records before they're expired"
+ opt.description = "Threshold (in seconds) of the age of data before it is expired"
def check(self):
if os.getuid() not in (os.stat(__file__).st_uid, 0):
@@ -80,8 +80,8 @@
ddef = "postgresql://cumin@localhost/cumin"
freqDefault = 600 # 10 minutes
thresholdDefault = 24 * 3600 # 1 day
- model = MintModel(opts.get("data", ddef), opts.get("dbexpire-frequency", freqDefault), \
- opts.get("dbexpire-threshold", thresholdDefault), debug=True)
+ model = MintModel(opts.get("data", ddef), opts.get("expire-frequency", freqDefault), \
+ opts.get("expire-threshold", thresholdDefault), debug=True)
model.check()
model.init()
17 years, 4 months
rhmessaging commits: r2904 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-12-02 11:54:29 -0500 (Tue, 02 Dec 2008)
New Revision: 2904
Modified:
mgmt/trunk/mint/python/mint/tools.py
Log:
remove prints used for debugging
Modified: mgmt/trunk/mint/python/mint/tools.py
===================================================================
--- mgmt/trunk/mint/python/mint/tools.py 2008-12-02 16:52:14 UTC (rev 2903)
+++ mgmt/trunk/mint/python/mint/tools.py 2008-12-02 16:54:29 UTC (rev 2904)
@@ -83,9 +83,6 @@
model = MintModel(opts.get("data", ddef), opts.get("dbexpire-frequency", freqDefault), \
opts.get("dbexpire-threshold", thresholdDefault), debug=True)
- print opts.get("dbexpire-frequency", freqDefault)
- print opts.get("dbexpire-threshold", thresholdDefault)
-
model.check()
model.init()
model.start()
17 years, 4 months
rhmessaging commits: r2903 - in mgmt/trunk: mint/python/mint and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-12-02 11:52:14 -0500 (Tue, 02 Dec 2008)
New Revision: 2903
Modified:
mgmt/trunk/cumin/python/cumin/__init__.py
mgmt/trunk/cumin/python/cumin/model.py
mgmt/trunk/mint/python/mint/__init__.py
mgmt/trunk/mint/python/mint/dbexpire.py
mgmt/trunk/mint/python/mint/sql.py
mgmt/trunk/mint/python/mint/tools.py
Log:
make the expiration of db records configurable via two params (in cumin.conf and/or in command line): dbexpire-frequency and dbexpire-threshold
Modified: mgmt/trunk/cumin/python/cumin/__init__.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/__init__.py 2008-12-01 21:00:26 UTC (rev 2902)
+++ mgmt/trunk/cumin/python/cumin/__init__.py 2008-12-02 16:52:14 UTC (rev 2903)
@@ -37,7 +37,7 @@
self.add_resource_dir(os.path.join(self.home, "resources-wooly"))
self.add_resource_dir(os.path.join(self.home, "resources"))
- self.model = CuminModel(self, self.config.data, self.config.spec)
+ self.model = CuminModel(self, self.config.data)
self.main_page = MainPage(self, "index.html")
self.add_page(self.main_page)
@@ -167,6 +167,12 @@
param = ConfigParameter(self, "user", str)
+ param = ConfigParameter(self, "dbexpire-frequency", int)
+ param.default = 600 # 10 minutes
+
+ param = ConfigParameter(self, "dbexpire-threshold", int)
+ param.default = 24 * 3600 # 1 day
+
def init(self):
super(CuminConfig, self).init()
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-12-01 21:00:26 UTC (rev 2902)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-12-02 16:52:14 UTC (rev 2903)
@@ -18,9 +18,10 @@
log = logging.getLogger("cumin.model")
class CuminModel(object):
- def __init__(self, app, data_uri, spec_path):
+ def __init__(self, app, data_uri):
self.app = app
- self.data = MintModel(data_uri, spec_path, debug=False)
+ self.data = MintModel(data_uri, dbExpireFrequency=app.config.dbexpire_frequency, \
+ dbExpireThreshold=app.config.dbexpire_threshold, debug=False)
self.classes = list()
self.invocations = set()
Modified: mgmt/trunk/mint/python/mint/__init__.py
===================================================================
--- mgmt/trunk/mint/python/mint/__init__.py 2008-12-01 21:00:26 UTC (rev 2902)
+++ mgmt/trunk/mint/python/mint/__init__.py 2008-12-02 16:52:14 UTC (rev 2903)
@@ -313,7 +313,7 @@
class MintModel(qmf.console.Console):
staticInstance = None
- def __init__(self, dataUri, specPath="", debug=False):
+ def __init__(self, dataUri, dbExpireFrequency, dbExpireThreshold, debug=False):
self.dataUri = dataUri
self.debug = debug
@@ -325,7 +325,7 @@
self.__lock = RLock()
self.dbConn = None
- self.dbExpireThread = dbexpire.DBExpireThread(self)
+ self.dbExpireThread = dbexpire.DBExpireThread(self, frequency=dbExpireFrequency, threshold=dbExpireThreshold)
self.updateThread = update.ModelUpdateThread(self)
self.mgmtSession = qmf.console.Session(self, manageConnections=True)
self.outstandingMethodCalls = dict()
Modified: mgmt/trunk/mint/python/mint/dbexpire.py
===================================================================
--- mgmt/trunk/mint/python/mint/dbexpire.py 2008-12-01 21:00:26 UTC (rev 2902)
+++ mgmt/trunk/mint/python/mint/dbexpire.py 2008-12-02 16:52:14 UTC (rev 2903)
@@ -8,20 +8,20 @@
log = logging.getLogger("mint.dbexpire")
class DBExpireThread(Thread):
- def __init__(self, model, frequency=600, expiration=24*3600, keepCurrStats=False):
+ def __init__(self, model, frequency, threshold, keepCurrStats=False):
super(DBExpireThread, self).__init__()
self.model = model
self.setDaemon(False)
self.stopRequested = False
self.frequency = frequency
- self.expiration = expiration
+ self.threshold = threshold
self.keepCurrStats = keepCurrStats
frequency_out, frequency_unit = self.convertTimeUnits(frequency)
- expiration_out, expiration_unit = self.convertTimeUnits(expiration)
+ threshold_out, threshold_unit = self.convertTimeUnits(threshold)
log.debug("Expiring database records older than %d %s, every %d %s" \
- % (expiration_out, expiration_unit, frequency_out, frequency_unit))
+ % (threshold_out, threshold_unit, frequency_out, frequency_unit))
def run(self):
ops = []
@@ -30,7 +30,7 @@
ops.append(SqlExpire(Job, self.keepCurrStats))
attrs = dict()
- attrs["expiration"] = self.expiration
+ attrs["threshold"] = self.threshold
conn = self.model.dbConn.getConnection()
Modified: mgmt/trunk/mint/python/mint/sql.py
===================================================================
--- mgmt/trunk/mint/python/mint/sql.py 2008-12-01 21:00:26 UTC (rev 2902)
+++ mgmt/trunk/mint/python/mint/sql.py 2008-12-02 16:52:14 UTC (rev 2903)
@@ -152,14 +152,14 @@
parent_table = table[0:table.find("_stats")]
sql = """
delete from %s
- where qmf_update_time < now() - interval '%%(expiration)s seconds'
+ where qmf_update_time < now() - interval '%%(threshold)s seconds'
""" % (table)
if self.keepCurrStats:
sql += " and id not in (select stats_curr_id from %s)" % (parent_table)
else:
sql = """
delete from %s
- where qmf_create_time < now() - interval '%%(expiration)s seconds'
+ where qmf_create_time < now() - interval '%%(threshold)s seconds'
""" % (table)
return sql
Modified: mgmt/trunk/mint/python/mint/tools.py
===================================================================
--- mgmt/trunk/mint/python/mint/tools.py 2008-12-01 21:00:26 UTC (rev 2902)
+++ mgmt/trunk/mint/python/mint/tools.py 2008-12-02 16:52:14 UTC (rev 2903)
@@ -26,6 +26,14 @@
opt = CommandOption(self, "debug")
opt.description = "Enable debugging; print logging to console"
+ opt = CommandOption(self, "dbexpire-frequency")
+ opt.argument = "FREQUENCY"
+ opt.description = "Frequency (in seconds) of the database expiration thread"
+
+ opt = CommandOption(self, "dbexpire-threshold")
+ opt.argument = "THRESHOLD"
+ opt.description = "Threshold (in seconds) of the age of database records before they're expired"
+
def check(self):
if os.getuid() not in (os.stat(__file__).st_uid, 0):
print "Error: You have insufficient privileges"
@@ -70,8 +78,14 @@
def do_run(self, opts, args):
ddef = "postgresql://cumin@localhost/cumin"
- model = MintModel(opts.get("data", ddef), debug=True)
+ freqDefault = 600 # 10 minutes
+ thresholdDefault = 24 * 3600 # 1 day
+ model = MintModel(opts.get("data", ddef), opts.get("dbexpire-frequency", freqDefault), \
+ opts.get("dbexpire-threshold", thresholdDefault), debug=True)
+ print opts.get("dbexpire-frequency", freqDefault)
+ print opts.get("dbexpire-threshold", thresholdDefault)
+
model.check()
model.init()
model.start()
17 years, 4 months
rhmessaging commits: r2902 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2008-12-01 16:00:26 -0500 (Mon, 01 Dec 2008)
New Revision: 2902
Modified:
mgmt/trunk/cumin/python/cumin/slot.strings
Log:
Changing sql to use qmf_delete_time
Modified: mgmt/trunk/cumin/python/cumin/slot.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/slot.strings 2008-12-01 20:23:32 UTC (rev 2901)
+++ mgmt/trunk/cumin/python/cumin/slot.strings 2008-12-01 21:00:26 UTC (rev 2902)
@@ -17,7 +17,7 @@
[SlotSet.count_sql]
select count(1)
-from (select distinct name, machine, system, pool, deletion_time from slot as s {sql_where}) as s
+from (select distinct name, machine, system, pool, qmf_delete_time from slot as s {sql_where}) as s
[MachineSet.sql]
17 years, 4 months
rhmessaging commits: r2901 - mgmt/trunk/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: nunofsantos
Date: 2008-12-01 15:23:32 -0500 (Mon, 01 Dec 2008)
New Revision: 2901
Modified:
mgmt/trunk/mint/python/mint/dbexpire.py
mgmt/trunk/mint/python/mint/sql.py
Log:
add an optional keepCurrStats param to the database cleanup thread; now the default behavior is to delete any old stats, regardless of whether they're the current stats of any object
Modified: mgmt/trunk/mint/python/mint/dbexpire.py
===================================================================
--- mgmt/trunk/mint/python/mint/dbexpire.py 2008-12-01 19:56:35 UTC (rev 2900)
+++ mgmt/trunk/mint/python/mint/dbexpire.py 2008-12-01 20:23:32 UTC (rev 2901)
@@ -8,7 +8,7 @@
log = logging.getLogger("mint.dbexpire")
class DBExpireThread(Thread):
- def __init__(self, model, frequency=600, expiration=24*3600):
+ def __init__(self, model, frequency=600, expiration=24*3600, keepCurrStats=False):
super(DBExpireThread, self).__init__()
self.model = model
@@ -16,6 +16,7 @@
self.stopRequested = False
self.frequency = frequency
self.expiration = expiration
+ self.keepCurrStats = keepCurrStats
frequency_out, frequency_unit = self.convertTimeUnits(frequency)
expiration_out, expiration_unit = self.convertTimeUnits(expiration)
@@ -25,8 +26,8 @@
def run(self):
ops = []
for cls in mint.schema.statsClasses:
- ops.append(SqlExpire(eval(cls)))
- ops.append(SqlExpire(Job))
+ ops.append(SqlExpire(eval(cls), self.keepCurrStats))
+ ops.append(SqlExpire(Job, self.keepCurrStats))
attrs = dict()
attrs["expiration"] = self.expiration
Modified: mgmt/trunk/mint/python/mint/sql.py
===================================================================
--- mgmt/trunk/mint/python/mint/sql.py 2008-12-01 19:56:35 UTC (rev 2900)
+++ mgmt/trunk/mint/python/mint/sql.py 2008-12-01 20:23:32 UTC (rev 2901)
@@ -140,10 +140,11 @@
return sql
class SqlExpire(SqlOperation):
- def __init__(self, cls):
+ def __init__(self, cls, keepCurrStats):
super(SqlExpire, self).__init__("expire")
self.cls = cls
+ self.keepCurrStats = keepCurrStats
def generate(self):
table = self.cls.sqlmeta.table
@@ -152,8 +153,9 @@
sql = """
delete from %s
where qmf_update_time < now() - interval '%%(expiration)s seconds'
- and id not in (select stats_curr_id from %s)
- """ % (table, parent_table)
+ """ % (table)
+ if self.keepCurrStats:
+ sql += " and id not in (select stats_curr_id from %s)" % (parent_table)
else:
sql = """
delete from %s
17 years, 4 months