rhmessaging commits: r4216 - mgmt/newdata/mint/python/mint.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-08-23 11:24:21 -0400 (Mon, 23 Aug 2010)
New Revision: 4216
Modified:
mgmt/newdata/mint/python/mint/update.py
Log:
Use finer commit granularity to prevent stalls
Modified: mgmt/newdata/mint/python/mint/update.py
===================================================================
--- mgmt/newdata/mint/python/mint/update.py 2010-08-20 17:57:14 UTC (rev 4215)
+++ mgmt/newdata/mint/python/mint/update.py 2010-08-23 15:24:21 UTC (rev 4216)
@@ -523,6 +523,8 @@
stats.deleted += count
+ cursor.connection.commit()
+
class AgentDelete(AgentUpdate):
def do_process(self, cursor, stats):
agent_id = self.get_agent_id()
14 years, 4 months
rhmessaging commits: r4215 - store/trunk/cpp/rhel4-support.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-08-20 13:57:14 -0400 (Fri, 20 Aug 2010)
New Revision: 4215
Modified:
store/trunk/cpp/rhel4-support/rhel4.patch
Log:
Correction to RHEL-4 patch
Modified: store/trunk/cpp/rhel4-support/rhel4.patch
===================================================================
--- store/trunk/cpp/rhel4-support/rhel4.patch 2010-08-20 14:03:13 UTC (rev 4214)
+++ store/trunk/cpp/rhel4-support/rhel4.patch 2010-08-20 17:57:14 UTC (rev 4215)
@@ -1,6 +1,6 @@
Index: tests/.valgrind.supp
===================================================================
---- tests/.valgrind.supp (revision 3545)
+--- tests/.valgrind.supp (revision 4214)
+++ tests/.valgrind.supp (working copy)
@@ -1,33 +1,74 @@
{
@@ -102,7 +102,7 @@
Index: configure.ac
===================================================================
---- configure.ac (revision 3545)
+--- configure.ac (revision 4214)
+++ configure.ac (working copy)
@@ -62,7 +62,6 @@
# -Wshadow - warns about boost headers.
@@ -122,16 +122,19 @@
AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS])
Index: lib/MessageStoreImpl.cpp
===================================================================
---- lib/MessageStoreImpl.cpp (revision 3545)
-+++ lib/MessageStoreImpl.cpp (working copy)
-@@ -314,10 +314,6 @@
- dbenv->set_lg_regionmax(256000); // default = 65000
- dbenv->open(getBdbBaseDir().c_str(), DB_THREAD | DB_CREATE | DB_INIT_TXN | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | DB_USE_ENVIRON | DB_RECOVER, 0);
- } catch (const DbException& e) {
-- if (e.get_errno() == DB_VERSION_MISMATCH)
-- THROW_STORE_EXCEPTION_2("Database environment mismatch: This version of bd4 does not match that which created the store database. "
-- "(If recovery is not important, delete the contents of the store directory. Otherwise, try upgrading the database using "
-- "db_upgrade or using db_recover - but the db4-utils package must also be installed to use these utilities.)", e);
- THROW_STORE_EXCEPTION_2("Error opening environment", e);
- }
-
+ --- lib/MessageStoreImpl.cpp (revision 4214)
++++ lib/MessageStoreImpl.cpp (working copy)
+@@ -355,13 +355,6 @@
+ tplStorePtr.reset(new TplJournalImpl(timer, "TplStore", getTplBaseDir(), "tpl", defJournalGetEventsTimeout, defJournalFlushTimeout, agent));
+ isInit = true;
+ } catch (const DbException& e) {
+- if (e.get_errno() == DB_VERSION_MISMATCH)
+- {
+- QPID_LOG(error, "Database environment mismatch: This version of db4 does not match that which created the store database.: " << e.what());
+- THROW_STORE_EXCEPTION_2("Database environment mismatch: This version of db4 does not match that which created the store database. "
+- "(If recovery is not important, delete the contents of the store directory. Otherwise, try upgrading the database using "
+- "db_upgrade or using db_recover - but the db4-utils package must also be installed to use these utilities.)", e);
+- }
+ QPID_LOG(error, "BDB exception occurred while initializing store: " << e.what());
+ if (bdbRetryCnt >= retryMax)
+ THROW_STORE_EXCEPTION_2("BDB exception occurred while initializing store", e);
14 years, 4 months
rhmessaging commits: r4214 - mgmt/newdata/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-08-20 10:03:13 -0400 (Fri, 20 Aug 2010)
New Revision: 4214
Modified:
mgmt/newdata/cumin/python/cumin/OpenFlashChart.py
Log:
Remove some processing of the json output since it is now handled in the swf.
Modified: mgmt/newdata/cumin/python/cumin/OpenFlashChart.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/OpenFlashChart.py 2010-08-19 17:12:41 UTC (rev 4213)
+++ mgmt/newdata/cumin/python/cumin/OpenFlashChart.py 2010-08-20 14:03:13 UTC (rev 4214)
@@ -83,11 +83,7 @@
return json.dumps(attributes)
else:
return str(attributes).\
- replace("': u'", "': '").\
- replace(": True,", ": true,").\
- replace(": False,", ": false,").\
- replace("L, ", ", ")
+ replace("': u'", "': '")
-
class Element(Chart):
pass
\ No newline at end of file
14 years, 4 months
rhmessaging commits: r4213 - in store/trunk/cpp: lib/jrnl and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-08-19 13:12:41 -0400 (Thu, 19 Aug 2010)
New Revision: 4213
Removed:
store/trunk/cpp/lib/jrnl/arr_cnt.cpp
store/trunk/cpp/lib/jrnl/arr_cnt.hpp
store/trunk/cpp/tests/jrnl/_ut_arr_cnt.cpp
Modified:
store/trunk/cpp/lib/Makefile.am
store/trunk/cpp/lib/jrnl/enq_map.cpp
store/trunk/cpp/lib/jrnl/enq_map.hpp
store/trunk/cpp/lib/jrnl/txn_map.cpp
store/trunk/cpp/lib/jrnl/txn_map.hpp
store/trunk/cpp/tests/jrnl/Makefile.am
store/trunk/cpp/tests/jrnl/_ut_enq_map.cpp
store/trunk/cpp/tests/jrnl/_ut_txn_map.cpp
Log:
Removed class arr_cnt and replaced it with an instance of std::vector<u_int32_t>. The corresponding unit test was also removed. Tests of enq_map and txn_map were fixed (having an undiscovered logic error in them).
Modified: store/trunk/cpp/lib/Makefile.am
===================================================================
--- store/trunk/cpp/lib/Makefile.am 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/lib/Makefile.am 2010-08-19 17:12:41 UTC (rev 4213)
@@ -60,7 +60,6 @@
StoreException.h \
TxnCtxt.h \
jrnl/aio.cpp \
- jrnl/arr_cnt.cpp \
jrnl/cvar.cpp \
jrnl/data_tok.cpp \
jrnl/deq_rec.cpp \
@@ -88,7 +87,6 @@
jrnl/wrfc.cpp \
jrnl/aio.hpp \
jrnl/aio_callback.hpp \
- jrnl/arr_cnt.hpp \
jrnl/cvar.hpp \
jrnl/data_tok.hpp \
jrnl/deq_hdr.hpp \
Deleted: store/trunk/cpp/lib/jrnl/arr_cnt.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/arr_cnt.cpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/lib/jrnl/arr_cnt.cpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -1,171 +0,0 @@
-/**
- * \file arr_cnt.cpp
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::arr_cnt (enqueue map). See
- * comments in file arr_cnt.hpp for details.
- *
- * \author Kim van der Riet
- *
- * Copyright (c) 2007, 2008 Red Hat Inc.
- *
- * This file is part of the Qpid async store library msgstore.so.
- *
- * This library 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.
- */
-
-#include "jrnl/arr_cnt.hpp"
-
-#include <cassert>
-
-namespace mrg
-{
-namespace journal
-{
-
-arr_cnt::arr_cnt(): _size(0), _cnt_arr_ptr(0)
-{}
-
-arr_cnt::~arr_cnt()
-{
- clean(_cnt_arr_ptr, _size);
-}
-
-void
-arr_cnt::set_size(const u_int16_t size)
-{
- u_int16_t old_size = _size;
- u_int32_t** old_cnt_arr_ptr = _cnt_arr_ptr;
- _size = size;
- if (_size)
- {
- _cnt_arr_ptr = new u_int32_t*[_size];
- for (u_int16_t i=0; i<_size; i++)
- {
- _cnt_arr_ptr[i] = new u_int32_t;
- // transfer counts from old file array
- *_cnt_arr_ptr[i] = i < old_size ? *(old_cnt_arr_ptr[i]) : u_int32_t(0);
- }
- }
- else
- _cnt_arr_ptr = 0;
- clean(old_cnt_arr_ptr, old_size);
-}
-
-u_int32_t
-arr_cnt::cnt(const u_int16_t index) const
-{
- assert(_size == 0 || index < _size);
- if (_cnt_arr_ptr)
- return *(_cnt_arr_ptr[index]);
- return 0;
-}
-
-u_int32_t
-arr_cnt::incr(const u_int16_t index)
-{
- assert(_size == 0 || index < _size);
- if (_cnt_arr_ptr)
- return ++(*(_cnt_arr_ptr[index]));
- return 0;
-}
-
-u_int32_t
-arr_cnt::decr(const u_int16_t index)
-{
- assert(_size == 0 || index < _size);
- if (_cnt_arr_ptr)
- {
- assert(*(_cnt_arr_ptr[index]) > 0);
- return --(*(_cnt_arr_ptr[index]));
- }
- return 0;
-}
-
-u_int32_t
-arr_cnt::add(const u_int16_t index, u_int32_t amt)
-{
- assert(_size == 0 || index < _size);
- if (_cnt_arr_ptr)
- {
- *(_cnt_arr_ptr[index]) += amt;
- return *(_cnt_arr_ptr[index]);
- }
- return 0;
-}
-
-u_int32_t
-arr_cnt::sub(const u_int16_t index, u_int32_t amt)
-{
- assert(_size == 0 || index < _size);
- if (_cnt_arr_ptr)
- {
- assert(*(_cnt_arr_ptr[index]) >= amt);
- *(_cnt_arr_ptr[index]) -= amt;
- return *(_cnt_arr_ptr[index]);
- }
- return 0;
-}
-
-void
-arr_cnt::set_cnt(const u_int16_t index, u_int32_t val)
-{
- assert(_size == 0 || index < _size);
- if (_cnt_arr_ptr)
- *(_cnt_arr_ptr[index]) = val;
-}
-
-void
-arr_cnt::clear_cnt(const u_int16_t index)
-{
- assert(_size == 0 || index < _size);
- if (_cnt_arr_ptr)
- *(_cnt_arr_ptr[index]) = 0;
-}
-
-void
-arr_cnt::clear_all()
-{
- if (_cnt_arr_ptr)
- {
- for (u_int16_t i=0; i<_size; i++)
- *(_cnt_arr_ptr[i]) = 0;
- }
-}
-
-void
-arr_cnt::clean(u_int32_t** cnt_arr_ptr, const u_int16_t size)
-{
- if (cnt_arr_ptr)
- {
- for (u_int16_t i=0; i<size; i++)
- {
- if (cnt_arr_ptr[i])
- {
- delete cnt_arr_ptr[i];
- cnt_arr_ptr[i] = 0;
- }
- }
- delete[] cnt_arr_ptr;
- cnt_arr_ptr = 0;
- }
-}
-
-} // namespace journal
-} // namespace mrg
Deleted: store/trunk/cpp/lib/jrnl/arr_cnt.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/arr_cnt.hpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/lib/jrnl/arr_cnt.hpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -1,79 +0,0 @@
-/**
- * \file arr_cnt.hpp
- *
- * Qpid asynchronous store plugin library
- *
- * File containing code for class mrg::journal::arr_cnt (array counter).
- * See class documentation for details.
- *
- * \author Kim van der Riet
- *
- * Copyright (c) 2007, 2008 Red Hat Inc.
- *
- * This file is part of the Qpid async store library msgstore.so.
- *
- * This library 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_arr_cnt_hpp
-#define mrg_journal_arr_cnt_hpp
-
-#include <sys/types.h>
-
-namespace mrg
-{
-namespace journal
-{
-
- /**
- * \class arr_cnt
- * \brief Class which implements a dynamically allocated array of u_int32_t counters.
- * This is ideal where it is necessary to increment and decrement counts for an entity
- * for which the number of elements is unknown, but for which the efficiency of a static
- * array is required. None of the counts may go below zero.
- */
-
- // TODO: Replace this class with instance of std::vector<u_int32_t>
- class arr_cnt
- {
- private:
- u_int16_t _size;
- u_int32_t** _cnt_arr_ptr;
-
- public:
- arr_cnt();
- virtual ~arr_cnt();
-
- inline u_int16_t size() const { return _size; }
- void set_size(const u_int16_t size);
- u_int32_t cnt(const u_int16_t index) const;
- u_int32_t incr(const u_int16_t index);
- u_int32_t decr(const u_int16_t index);
- u_int32_t add(const u_int16_t index, u_int32_t amt);
- u_int32_t sub(const u_int16_t index, u_int32_t amt);
- void set_cnt(const u_int16_t index, u_int32_t val);
- void clear_cnt(const u_int16_t index);
- void clear_all();
- private:
- void clean(u_int32_t** cnt_arr_ptr, const u_int16_t size);
- };
-
-} // namespace journal
-} // namespace mrg
-
-#endif // ifndef mrg_journal_arr_cnt_hpp
Modified: store/trunk/cpp/lib/jrnl/enq_map.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_map.cpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/lib/jrnl/enq_map.cpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -61,7 +61,7 @@
void
enq_map::set_num_jfiles(const u_int16_t num_jfiles)
{
- _pfid_enq_cnt.set_size(num_jfiles);
+ _pfid_enq_cnt.resize(num_jfiles, 0);
}
@@ -82,7 +82,7 @@
}
if (ret.second == false)
return EMAP_DUP_RID;
- _pfid_enq_cnt.incr(pfid);
+ _pfid_enq_cnt.at(pfid)++;
return EMAP_OK;
}
@@ -109,7 +109,7 @@
return EMAP_LOCKED;
u_int16_t pfid = itr->second._pfid;
_map.erase(itr);
- _pfid_enq_cnt.decr(pfid);
+ _pfid_enq_cnt.at(pfid)--;
return pfid;
}
Modified: store/trunk/cpp/lib/jrnl/enq_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/enq_map.hpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/lib/jrnl/enq_map.hpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -41,7 +41,6 @@
}
}
-#include "jrnl/arr_cnt.hpp"
#include "jrnl/jexception.hpp"
#include "jrnl/smutex.hpp"
#include <map>
@@ -98,14 +97,14 @@
emap _map;
smutex _mutex;
- arr_cnt _pfid_enq_cnt;
+ std::vector<u_int32_t> _pfid_enq_cnt;
public:
enq_map();
virtual ~enq_map();
void set_num_jfiles(const u_int16_t num_jfiles);
- inline u_int32_t get_enq_cnt(const u_int16_t pfid) const { return _pfid_enq_cnt.cnt(pfid); };
+ inline u_int32_t get_enq_cnt(const u_int16_t pfid) const { return _pfid_enq_cnt.at(pfid); };
int16_t insert_pfid(const u_int64_t rid, const u_int16_t pfid); // 0=ok; -3=duplicate rid;
int16_t insert_pfid(const u_int64_t rid, const u_int16_t pfid, const bool locked); // 0=ok; -3=duplicate rid;
Modified: store/trunk/cpp/lib/jrnl/txn_map.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.cpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/lib/jrnl/txn_map.cpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -70,13 +70,13 @@
void
txn_map::set_num_jfiles(const u_int16_t num_jfiles)
{
- _pfid_txn_cnt.set_size(num_jfiles);
+ _pfid_txn_cnt.resize(num_jfiles, 0);
}
u_int32_t
txn_map::get_txn_pfid_cnt(const u_int16_t pfid) const
{
- return _pfid_txn_cnt.cnt(pfid);
+ return _pfid_txn_cnt.at(pfid);
}
bool
@@ -95,7 +95,7 @@
}
else
itr->second.push_back(td);
- _pfid_txn_cnt.incr(td._pfid);
+ _pfid_txn_cnt.at(td._pfid)++;
return ok;
}
@@ -125,7 +125,7 @@
txn_data_list list = itr->second;
_map.erase(itr);
for (tdl_itr i=list.begin(); i!=list.end(); i++)
- _pfid_txn_cnt.decr(i->_pfid);
+ _pfid_txn_cnt.at(i->_pfid)--;
return list;
}
Modified: store/trunk/cpp/lib/jrnl/txn_map.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/txn_map.hpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/lib/jrnl/txn_map.hpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -41,7 +41,6 @@
}
}
-#include "jrnl/arr_cnt.hpp"
#include "jrnl/smutex.hpp"
#include <map>
#include <pthread.h>
@@ -126,7 +125,7 @@
xmap _map;
smutex _mutex;
- arr_cnt _pfid_txn_cnt;
+ std::vector<u_int32_t> _pfid_txn_cnt;
const txn_data_list _empty_data_list;
public:
Modified: store/trunk/cpp/tests/jrnl/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/Makefile.am 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/tests/jrnl/Makefile.am 2010-08-19 17:12:41 UTC (rev 4213)
@@ -43,7 +43,6 @@
TESTS = \
_ut_time_ns \
- _ut_arr_cnt \
_ut_jexception \
_ut_jerrno \
_ut_rec_hdr \
@@ -66,7 +65,6 @@
check_PROGRAMS = \
_ut_time_ns \
- _ut_arr_cnt \
_ut_jexception \
_ut_jerrno \
_ut_rec_hdr \
@@ -90,9 +88,6 @@
_ut_time_ns_SOURCES = _ut_time_ns.cpp $(UNIT_TEST_SRCS)
_ut_time_ns_LDADD = $(UNIT_TEST_LDADD)
-_ut_arr_cnt_SOURCES = _ut_arr_cnt.cpp $(UNIT_TEST_SRCS)
-_ut_arr_cnt_LDADD = $(UNIT_TEST_LDADD) -lrt
-
_ut_jexception_SOURCES = _ut_jexception.cpp $(UNIT_TEST_SRCS)
_ut_jexception_LDADD = $(UNIT_TEST_LDADD) -lrt
Deleted: store/trunk/cpp/tests/jrnl/_ut_arr_cnt.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_arr_cnt.cpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/tests/jrnl/_ut_arr_cnt.cpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2008 Red Hat, Inc.
- *
- * This file is part of the Qpid async store library msgstore.so.
- *
- * This library 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.
- */
-
-#include "../unit_test.h"
-
-#include <iostream>
-#include "jrnl/arr_cnt.hpp"
-
-using namespace boost::unit_test;
-using namespace mrg::journal;
-using namespace std;
-
-QPID_AUTO_TEST_SUITE(arr_cnt_suite)
-
-const string test_filename("_ut_arr_cnt");
-
-QPID_AUTO_TEST_CASE(default_constructor)
-{
- cout << test_filename << ".default_constructor: " << flush;
- arr_cnt a1;
- BOOST_CHECK_EQUAL(a1.size(), u_int16_t(0));
- BOOST_CHECK_EQUAL(a1.cnt(0), u_int32_t(0));
- BOOST_CHECK_EQUAL(a1.incr(0), u_int32_t(0));
- BOOST_CHECK_EQUAL(a1.decr(0), u_int32_t(0));
- BOOST_CHECK_EQUAL(a1.add(0, 100), u_int32_t(0));
- BOOST_CHECK_EQUAL(a1.sub(0, 100), u_int32_t(0));
- a1.set_cnt(0, 100);
- a1.clear_cnt(0);
- a1.clear_all();
- cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(basic_fns)
-{
- cout << test_filename << ".basic_fns: " << flush;
- const u_int16_t num_elts = 8;
- arr_cnt a2;
- BOOST_CHECK_EQUAL(a2.size(), u_int16_t(0));
- a2.set_size(num_elts);
- BOOST_CHECK_EQUAL(a2.size(), num_elts);
- for (u_int16_t i=0; i<num_elts; i++)
- {
- BOOST_CHECK_EQUAL(a2.cnt(i), u_int32_t(0));
- BOOST_CHECK_EQUAL(a2.incr(i), u_int32_t(1));
- BOOST_CHECK_EQUAL(a2.decr(i), u_int32_t(0));
- BOOST_CHECK_EQUAL(a2.add(i, 100), u_int32_t(100));
- BOOST_CHECK_EQUAL(a2.sub(i, 100), u_int32_t(0));
- a2.set_cnt(i, 100);
- a2.set_cnt(i, 100);
- BOOST_CHECK_EQUAL(a2.cnt(i), u_int32_t(100));
- a2.clear_cnt(i);
- BOOST_CHECK_EQUAL(a2.cnt(i), u_int32_t(0));
- a2.set_cnt(i, i);
- }
- a2.clear_all();
- for (u_int16_t i=0; i<num_elts; i++)
- BOOST_CHECK_EQUAL(a2.cnt(i), u_int32_t(0));
- cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(resize)
-{
- cout << test_filename << ".resize: " << flush;
- arr_cnt a3;
- BOOST_CHECK_EQUAL(a3.size(), u_int16_t(0));
- a3.set_size(8);
- BOOST_CHECK_EQUAL(a3.size(), u_int16_t(8));
- a3.set_size(1000);
- BOOST_CHECK_EQUAL(a3.size(), u_int16_t(1000));
- a3.set_size(4);
- BOOST_CHECK_EQUAL(a3.size(), u_int16_t(4));
- a3.set_size(0);
- BOOST_CHECK_EQUAL(a3.size(), u_int16_t(0));
- a3.set_size(10);
- BOOST_CHECK_EQUAL(a3.size(), u_int16_t(10));
- cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(resize_up_transfer_cnt)
-{
- cout << test_filename << ".transfer_up: " << flush;
- const u_int16_t num_elts = 8;
- arr_cnt a4;
- a4.set_size(num_elts);
- for (u_int16_t i=0; i<num_elts; i++)
- a4.set_cnt(i, i*i);
- a4.set_size(2*num_elts);
- for (u_int16_t i=0; i<num_elts; i++)
- BOOST_CHECK_EQUAL(a4.cnt(i), u_int32_t(i*i));
- for (u_int16_t i=num_elts; i<2*num_elts; i++)
- BOOST_CHECK_EQUAL(a4.cnt(i), u_int32_t(0));
- cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(resize_down_transfer_cnt)
-{
- cout << test_filename << ".transfer_up: " << flush;
- const u_int16_t num_elts = 16;
- arr_cnt a5;
- a5.set_size(num_elts);
- for (u_int16_t i=0; i<num_elts; i++)
- a5.set_cnt(i, i*i);
- a5.set_size(num_elts/2);
- for (u_int16_t i=0; i<num_elts/2; i++)
- BOOST_CHECK_EQUAL(a5.cnt(i), u_int32_t(i*i));
- cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_CASE(null_immunity_after_resize_to_zero)
-{
- cout << test_filename << ".null_immunity_after_resize_to_zero: " << flush;
- arr_cnt a6;
- a6.set_size(8);
- a6.set_size(0);
- BOOST_CHECK_EQUAL(a6.size(), u_int16_t(0));
- BOOST_CHECK_EQUAL(a6.cnt(8), u_int32_t(0));
- BOOST_CHECK_EQUAL(a6.incr(8), u_int32_t(0));
- BOOST_CHECK_EQUAL(a6.decr(8), u_int32_t(0));
- BOOST_CHECK_EQUAL(a6.add(8, 100), u_int32_t(0));
- BOOST_CHECK_EQUAL(a6.sub(8, 100), u_int32_t(0));
- a6.set_cnt(8, 100);
- a6.clear_cnt(8);
- a6.clear_all();
- cout << "ok" << endl;
-}
-
-QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/_ut_enq_map.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_enq_map.cpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/tests/jrnl/_ut_enq_map.cpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -56,6 +56,7 @@
// insert with no dups
u_int64_t rid_incr_1 = 4ULL;
enq_map e2;
+ e2.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1, pfid++)
BOOST_CHECK_EQUAL(e2.insert_pfid(rid, pfid), enq_map::EMAP_OK);
BOOST_CHECK(!e2.empty());
@@ -113,6 +114,7 @@
u_int64_t rid_incr_1 = 4ULL;
u_int64_t num_incr_1 = (rid_end - rid_begin)/rid_incr_1;
enq_map e3;
+ e3.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1, pfid++)
BOOST_CHECK_EQUAL(e3.insert_pfid(rid, pfid), enq_map::EMAP_OK);
BOOST_CHECK_EQUAL(e3.size(), num_incr_1);
@@ -151,6 +153,7 @@
u_int64_t num_incr_1 = (rid_end - rid_begin)/rid_incr_1;
bool locked = false;
enq_map e4;
+ e4.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1, pfid++)
{
BOOST_CHECK_EQUAL(e4.insert_pfid(rid, pfid, locked), enq_map::EMAP_OK);
@@ -212,6 +215,7 @@
vector<u_int64_t> rid_list;
vector<u_int16_t> pfid_list;
enq_map e5;
+ e5.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
for (rid = rid_begin, pfid = pfid_start; rid < rid_end; rid += rid_incr_1, pfid++)
{
BOOST_CHECK_EQUAL(e5.insert_pfid(rid, pfid), enq_map::EMAP_OK);
@@ -295,6 +299,7 @@
u_int64_t num_rid = 10;
enq_map e7;
+ e7.set_num_jfiles(rid_begin + num_rid);
// insert even rids with no dups
for (rid = rid_begin, rid_cnt = u_int64_t(0); rid_cnt < num_rid; rid += 2ULL, rid_cnt++)
@@ -308,7 +313,6 @@
// remove even rids
for (rid = rid_begin, rid_cnt = u_int64_t(0); rid_cnt < num_rid; rid += 2ULL, rid_cnt++)
-// e7.Xget_remove_pfid(rid);
BOOST_CHECK(e7.get_remove_pfid(rid) >= enq_map::EMAP_OK);
BOOST_CHECK_EQUAL(e7.size(), num_rid);
Modified: store/trunk/cpp/tests/jrnl/_ut_txn_map.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_txn_map.cpp 2010-08-18 15:40:28 UTC (rev 4212)
+++ store/trunk/cpp/tests/jrnl/_ut_txn_map.cpp 2010-08-19 17:12:41 UTC (rev 4213)
@@ -82,14 +82,15 @@
cout << test_filename << ".insert_get: " << flush;
u_int16_t fid;
u_int64_t rid;
- u_int16_t fid_start = 0x2000U;
+ u_int16_t pfid_start = 0x2000U;
u_int64_t rid_begin = 0xffffffff00000000ULL;
u_int64_t rid_end = 0xffffffff00000200ULL;
// insert with no dups
u_int64_t rid_incr_1 = 4ULL;
txn_map t2;
- for (rid = rid_begin, fid = fid_start; rid < rid_end; rid += rid_incr_1, fid++)
+ t2.set_num_jfiles(pfid_start + (rid_end - rid_begin)/rid_incr_1);
+ for (rid = rid_begin, fid = pfid_start; rid < rid_end; rid += rid_incr_1, fid++)
t2.insert_txn_data(make_xid(rid), txn_data(rid, ~rid, fid, false));
BOOST_CHECK(!t2.empty());
BOOST_CHECK_EQUAL(t2.size(), u_int32_t(128));
14 years, 4 months
rhmessaging commits: r4212 - store/trunk/cpp/lib.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-08-18 11:40:28 -0400 (Wed, 18 Aug 2010)
New Revision: 4212
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/TxnCtxt.cpp
Log:
BZ 614944 - "qpidd broker crash in mrg::msgstore::TxnCtxt::abort() -> DbTxn::abort()". Added additional exception handling for store BDB initialization in TxnCtxt::begin() after QE came across another unhandled case.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-08-17 17:33:36 UTC (rev 4211)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-08-18 15:40:28 UTC (rev 4212)
@@ -365,6 +365,8 @@
QPID_LOG(error, "BDB exception occurred while initializing store: " << e.what());
if (bdbRetryCnt >= retryMax)
THROW_STORE_EXCEPTION_2("BDB exception occurred while initializing store", e);
+ } catch (const StoreException&) {
+ throw;
} catch (const journal::jexception& e) {
QPID_LOG(error, "Journal Exception occurred while initializing store: " << e);
THROW_STORE_EXCEPTION_2("Journal Exception occurred while initializing store", e.what());
Modified: store/trunk/cpp/lib/TxnCtxt.cpp
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.cpp 2010-08-17 17:33:36 UTC (rev 4211)
+++ store/trunk/cpp/lib/TxnCtxt.cpp 2010-08-18 15:40:28 UTC (rev 4212)
@@ -73,7 +73,7 @@
TxnCtxt::TxnCtxt(std::string _tid, IdSequence* _loggedtx) : loggedtx(_loggedtx), dtokp(new DataTokenImpl), preparedXidStorePtr(0), tid(_tid), txn(0) {}
-TxnCtxt::~TxnCtxt() { if(txn) abort(); }
+TxnCtxt::~TxnCtxt() { abort(); }
void TxnCtxt::sync() {
if (loggedtx) {
@@ -107,7 +107,14 @@
}
void TxnCtxt::begin(DbEnv* env, bool sync) {
- env->txn_begin(0, &txn, 0);
+ int err;
+ try { err = env->txn_begin(0, &txn, 0); }
+ catch (const DbException&) { txn = 0; throw; }
+ if (err != 0) {
+ std::ostringstream oss;
+ oss << "Error: Env::txn_begin() returned error code: " << err;
+ THROW_STORE_EXCEPTION(oss.str());
+ }
if (sync)
globalHolder = AutoScopedLock(new qpid::sys::Mutex::ScopedLock(globalSerialiser));
}
14 years, 4 months
rhmessaging commits: r4211 - in store/trunk/cpp/lib: jrnl and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-08-17 13:33:36 -0400 (Tue, 17 Aug 2010)
New Revision: 4211
Modified:
store/trunk/cpp/lib/TxnCtxt.cpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/lib/jrnl/jcntl.hpp
Log:
Fix for BZ 624452 - "Race condition in store orphans some TPL records, causing TPL to hit enqueue threshold".
Modified: store/trunk/cpp/lib/TxnCtxt.cpp
===================================================================
--- store/trunk/cpp/lib/TxnCtxt.cpp 2010-08-13 14:34:55 UTC (rev 4210)
+++ store/trunk/cpp/lib/TxnCtxt.cpp 2010-08-17 17:33:36 UTC (rev 4211)
@@ -100,8 +100,10 @@
void TxnCtxt::jrnl_sync(JournalImpl* jc, timespec* timeout) {
if (!jc || jc->is_txn_synced(getXid()))
return;
- if (jc->get_wr_events(timeout) == journal::jerrno::AIO_TIMEOUT && timeout)
- THROW_STORE_EXCEPTION(std::string("Error: timeout waiting for TxnCtxt::jrnl_sync()"));
+ while (jc->get_wr_aio_evt_rem()) {
+ if (jc->get_wr_events(timeout) == journal::jerrno::AIO_TIMEOUT && timeout)
+ THROW_STORE_EXCEPTION(std::string("Error: timeout waiting for TxnCtxt::jrnl_sync()"));
+ }
}
void TxnCtxt::begin(DbEnv* env, bool sync) {
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2010-08-13 14:34:55 UTC (rev 4210)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2010-08-17 17:33:36 UTC (rev 4211)
@@ -44,7 +44,6 @@
#include "jrnl/file_hdr.hpp"
#include "jrnl/jerrno.hpp"
#include "jrnl/jinf.hpp"
-#include "jrnl/slock.hpp"
#include <limits>
#include <sstream>
#include <unistd.h>
Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp 2010-08-13 14:34:55 UTC (rev 4210)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp 2010-08-17 17:33:36 UTC (rev 4211)
@@ -47,6 +47,7 @@
#include "jrnl/fcntl.hpp"
#include "jrnl/lpmgr.hpp"
#include "jrnl/rcvdat.hpp"
+#include "jrnl/slock.hpp"
#include "jrnl/smutex.hpp"
#include "jrnl/rmgr.hpp"
#include "jrnl/wmgr.hpp"
@@ -563,6 +564,10 @@
inline u_int32_t get_enq_cnt() const { return _emap.size(); }
+ inline u_int32_t get_wr_aio_evt_rem() const { slock l(_wr_mutex); return _wmgr.get_aio_evt_rem(); }
+
+ inline u_int32_t get_rd_aio_evt_rem() const { return _rmgr.get_aio_evt_rem(); }
+
inline u_int32_t get_wr_outstanding_aio_dblks() const
{ return _wrfc.aio_outstanding_dblks(); }
14 years, 4 months
rhmessaging commits: r4210 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: eallen
Date: 2010-08-13 10:34:55 -0400 (Fri, 13 Aug 2010)
New Revision: 4210
Modified:
mgmt/newdata/cumin/python/cumin/grid/negotiator.py
mgmt/newdata/cumin/python/cumin/grid/negotiator.strings
mgmt/newdata/cumin/python/cumin/grid/pool.py
Log:
Fix BZ 623476. Moved Group Config to Pool level, renamed to Quotas.
Modified: mgmt/newdata/cumin/python/cumin/grid/negotiator.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/negotiator.py 2010-08-13 13:31:44 UTC (rev 4209)
+++ mgmt/newdata/cumin/python/cumin/grid/negotiator.py 2010-08-13 14:34:55 UTC (rev 4210)
@@ -27,17 +27,7 @@
super(NegotiatorFrame, self).__init__(app, name, cls)
self.group_add = NegotiatorGroupAdd(app, self)
- self.edit_dynamic_quota = NegotiatorEditDynamicQuota(app, self)
- """
- self.edit_static_quota = NegotiatorEditStaticQuota(app, self)
- self.edit_prio_factor = NegotiatorEditPrioFactor(app, self)
- self.edit_regroup = NegotiatorEditRegroup(app, self)
- self.user_prio_factor = NegotiatorUserPrioFactor(app, self)
- self.user_regroup = NegotiatorUserRegroup(app, self)
- """
-
- overview = NegotiatorOverview(app, "overview", self.object, self)
- self.view.add_tab(overview)
+ #self.edit_dynamic_quota = NegotiatorEditDynamicQuota(app, self)
class NegotiatorSelector(ObjectSelector):
def __init__(self, app, name, pool):
@@ -119,29 +109,11 @@
col.title = "Dynamic Quota"
self.add_column(col)
- """
- task = frame.edit_static_quota
- col = QmfGroupColumn(app, "static", self.group_helper.get_static_quota, negotiator, task)
- col.title = "Static Quota"
+ col = self.SpacerColumn(app, "spacer")
self.add_column(col)
- task = frame.edit_prio_factor
- col = QmfGroupColumn(app, "factor", self.group_helper.get_priority_factor, negotiator, task)
- col.title = "Priority Factor"
- col.user = True
- col.user_task = frame.user_prio_factor
- self.add_column(col)
-
- task = frame.edit_regroup
- col = QmfGroupColumn(app, "regroup", self.group_helper.get_regroups, negotiator, task)
- col.title = "Auto Regroup"
- col.user = True
- col.user_task = frame.user_regroup
- self.add_column(col)
- """
-
def render_title(self, session):
- return "Group Configuration"
+ return "Quotas"
def render_class(self, session):
return "class=\"mobjects\""
@@ -227,7 +199,7 @@
class GroupColumn(ItemTableColumn):
def render_title(self, session, *args):
- return "Group"
+ return "Name"
def render_content(self, session, group):
# if a user
@@ -245,6 +217,13 @@
content = "%s%%" % str(round(float(value) * 100.0, 2))
return fmt_link(href, content, "", "", self.fmt_hover(""))
+ class SpacerColumn(ItemTableColumn):
+ def render_title(self, session, *args):
+ return ""
+
+ def render_content(self, session, _):
+ return ""
+
class GroupHelper(Widget):
def __init__(self, app, name, negotiator):
super(GroupHelper, self).__init__(app, name)
@@ -489,12 +468,11 @@
def __init__(self, app, name, task):
super(GroupForm, self).__init__(app, name, task)
- self.defer_enabled = True
+ cls = app.model.com_redhat_grid.Negotiator
+ self.negotiator = RosemaryObjectParameter(app, "neg", cls)
+ self.add_parameter(self.negotiator)
- #self.object = NegotiatorParameter(app, "negotiator")
- #self.add_parameter(self.object)
-
- self.group_helper = GroupHelper(app, "groups", self.object)
+ self.group_helper = GroupHelper(app, "groups", self.negotiator)
self.add_child(self.group_helper)
group_name = Parameter(app, "gn")
@@ -509,6 +487,8 @@
self.original_values = ListParameter(app, "original_values", original_value)
self.add_parameter(self.original_values)
+ self.defer_enabled = True
+
def render_group_name(self, session, group):
return group
@@ -684,7 +664,7 @@
return self.chart.render_id(session)
def process_submit(self, session):
- negotiator = self.object.get(session)
+ negotiator = self.negotiator.get(session)
quotas = self.quotas.get(session)
group_names = self.group_names.get(session)
original_values = self.original_values.get(session)
@@ -967,7 +947,7 @@
class NegotiatorGroupTask(ObjectFrameTask):
def do_exit(self, session):
- self.app.main_page.main.grid.pool.negotiator.view.show(session)
+ self.app.main_page.main.grid.pool.view.show(session)
def do_invoke(self, invoc, negotiator, group, value):
# don't call self.qmf_call here since we need to
@@ -1030,6 +1010,9 @@
group_leader = self.form.group_leader.get(osession)
self.form.group_leader.set(session, group_leader)
+ negotiator = self.frame.negotiator_attribute.get(osession)
+ self.form.negotiator.set(session, negotiator)
+
class NegotiatorEditStaticQuota(NegotiatorGroupTask):
def __init__(self, app, frame):
super(NegotiatorEditStaticQuota, self).__init__(app, frame)
Modified: mgmt/newdata/cumin/python/cumin/grid/negotiator.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/negotiator.strings 2010-08-13 13:31:44 UTC (rev 4209)
+++ mgmt/newdata/cumin/python/cumin/grid/negotiator.strings 2010-08-13 14:34:55 UTC (rev 4210)
@@ -20,6 +20,19 @@
width: 50%;
}
+th.SpacerColumn {
+ width: 25%;
+}
+
+table.mobjects th.DynamicColumn {
+ white-space: nowrap;
+ text-align: right;
+}
+table.mobjects td.DynamicColumn {
+ text-align: right;
+ padding-right: 2em;
+}
+
[NegotiatorOverview.html]
<div id="{id}" class="CuminTable GroupTable">
<table {class}>
Modified: mgmt/newdata/cumin/python/cumin/grid/pool.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-08-13 13:31:44 UTC (rev 4209)
+++ mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-08-13 14:34:55 UTC (rev 4210)
@@ -57,9 +57,6 @@
self.submission = SubmissionFrame(app, "submission")
self.add_mode(self.submission)
- #self.job = JobFrame(app, "job")
- #self.add_mode(self.job)
-
self.slot = SlotFrame(app, "slot")
self.add_mode(self.slot)
@@ -69,9 +66,6 @@
self.negotiator = NegotiatorFrame(app, "negotiator")
self.add_mode(self.negotiator)
- #self.collector = CollectorFrame(app, "coll")
- #elf.add_mode(self.collector)
-
self.limit = LimitFrame(app, "limit")
self.add_mode(self.limit)
@@ -90,6 +84,13 @@
negotiators = NegotiatorSelector(app, "negotiators", self.object)
self.view.add_tab(negotiators)
+ self.negotiator_attribute = self.NegotiatorAttribute(app, "neg", self.object)
+ self.add_attribute(self.negotiator_attribute)
+
+ self.edit_dynamic_quota = NegotiatorEditDynamicQuota(app, self)
+ self.quotas = NegotiatorOverview(app, "quotas", self.negotiator_attribute, self)
+ self.view.add_tab(self.quotas)
+
self.limits = LimitSet(app, "limits", self.object)
self.view.add_tab(self.limits)
@@ -98,11 +99,31 @@
#self.submission_vm_add = SubmissionVMAdd(app, self)
#self.submission_dag_add = SubmissionDagAdd(app, self)
- def do_process(self, session):
- #self.limits.limit_count.process(session)
+ class NegotiatorAttribute(Attribute):
+ def __init__(self, app, name, collector):
+ super(PoolFrame.NegotiatorAttribute, self).__init__(app, name)
- super(PoolFrame, self).do_process(session)
+ self.collector = collector
+ def get(self, session):
+ negotiator = super(PoolFrame.NegotiatorAttribute, self).get(session)
+ if not negotiator:
+ cls = self.app.model.com_redhat_grid.Negotiator
+
+ pool = self.collector.get(session)
+ if pool:
+ negotiators = cls.get_selection(session.cursor, Pool=pool.Name)
+ # use the most recently updated one if there are multiple
+ if len(negotiators) > 0:
+ recent_negotiator = negotiators[0]
+ for neg in negotiators:
+ if neg._qmf_update_time > \
+ recent_negotiator._qmf_update_time:
+ recent_negotiator = neg
+ self.set(session, recent_negotiator)
+ negotiator = recent_negotiator
+ return negotiator
+
class PoolOverview(Widget):
def __init__(self, app, name, collector):
super(PoolOverview, self).__init__(app, name)
14 years, 4 months
rhmessaging commits: r4209 - store/trunk/cpp/tools.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-08-13 09:31:44 -0400 (Fri, 13 Aug 2010)
New Revision: 4209
Modified:
store/trunk/cpp/tools/janal.py
store/trunk/cpp/tools/jerr.py
Log:
Fix for BZ 624033 - "Store tools regression - "Dequeuing non-existent rnqueue record""
Modified: store/trunk/cpp/tools/janal.py
===================================================================
--- store/trunk/cpp/tools/janal.py 2010-08-12 21:52:28 UTC (rev 4208)
+++ store/trunk/cpp/tools/janal.py 2010-08-13 13:31:44 UTC (rev 4209)
@@ -155,11 +155,10 @@
except jerr.JWarning:
# Not in emap, look for rid in tmap
l = self.find_rid(hdr.deq_rid, hdr.xid)
- if l == None:
- raise jerr.DequeueNonExistentEnqueueError(hdr.deq_rid)
- if l[2]:
- raise jerr.AlreadyLockedError(hdr.deq_rid)
- l[2] = True
+ if l != None:
+ if l[2]:
+ raise jerr.AlreadyLockedError(hdr.deq_rid)
+ l[2] = True
if hdr.xid in self.__map:
self.__map[hdr.xid].append([fid, hdr, False]) # append to existing list
else:
Modified: store/trunk/cpp/tools/jerr.py
===================================================================
--- store/trunk/cpp/tools/jerr.py 2010-08-12 21:52:28 UTC (rev 4208)
+++ store/trunk/cpp/tools/jerr.py 2010-08-13 13:31:44 UTC (rev 4209)
@@ -67,7 +67,7 @@
"""Error class for attempting to dequeue a non-existent enqueue record (rid)"""
def __init__(self, deq_rid):
"""Constructor"""
- Exception.__init__(self, "Dequeuing non-existent rnqueue record: rid=0x%s" % deq_rid)
+ Exception.__init__(self, "Dequeuing non-existent enqueue record: rid=0x%s" % deq_rid)
class DuplicateRidError(Exception):
"""Error class for placing duplicate rid into enqueue map"""
14 years, 4 months
rhmessaging commits: r4208 - mgmt/newdata/cumin/python/cumin/grid.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-08-12 17:52:28 -0400 (Thu, 12 Aug 2010)
New Revision: 4208
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
Log:
Remove redundant attrs; RequestMemory is an expression
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-12 21:44:33 UTC (rev 4207)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-12 21:52:28 UTC (rev 4208)
@@ -452,8 +452,6 @@
ad["JobVM_VCPUS"] = 1
ad["JobVMNetworking"] = False
ad["JobVMCheckpoint"] = False
- ad["JobVMMemory"] = memory
- ad["JobVMMemory"] = memory
# Requirements
@@ -475,6 +473,8 @@
# Descriptors
descriptors = dict()
+
+ descriptors["RequestMemory"] = "com.redhat.grid.Expression"
descriptors["Requirements"] = "com.redhat.grid.Expression"
ad["!!descriptors"] = descriptors
14 years, 4 months
rhmessaging commits: r4207 - in mgmt/newdata/cumin/python/cumin: usergrid and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2010-08-12 17:44:33 -0400 (Thu, 12 Aug 2010)
New Revision: 4207
Modified:
mgmt/newdata/cumin/python/cumin/grid/main.py
mgmt/newdata/cumin/python/cumin/grid/submission.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
Log:
* Based on design review, simplified fields for vm submit; more
optional fields will follow
* Moved vm submit logic into a dedicated task
Modified: mgmt/newdata/cumin/python/cumin/grid/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/main.py 2010-08-12 21:21:44 UTC (rev 4206)
+++ mgmt/newdata/cumin/python/cumin/grid/main.py 2010-08-12 21:44:33 UTC (rev 4207)
@@ -17,6 +17,7 @@
super(Module, self).__init__(app, name)
self.job_submit = JobSubmit(app)
+ self.vm_job_submit = VmJobSubmit(app)
# cls = app.model.com_redhat_grid.Job
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-12 21:21:44 UTC (rev 4206)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-12 21:44:33 UTC (rev 4207)
@@ -85,14 +85,29 @@
col = ObjectTableColumn(app, attr.name, attr)
self.insert_column(2, col)
- link = self.PoolSubmitLink(app, "add", app.grid.job_submit)
+ link = self.PoolSubmitLink(app, "job_submit", app.grid.job_submit)
self.links.add_child(link)
+ link = self.PoolSubmitLink \
+ (app, "vm_job_submit", app.grid.vm_job_submit)
+ self.links.add_child(link)
+
class PoolSubmitLink(TaskLink):
def do_enter(self, session, obj, form_session):
pool = self.parent.pool.get(session)
self.form.pool_name.set(form_session, pool.Pool)
+class JobDescriptionField(StringField):
+ def __init__(self, app, name):
+ super(JobDescriptionField, self).__init__(app, name)
+
+ self.input.size = 50
+ self.required = True
+ self.help = "This text will identify the submission"
+
+ def render_title(self, session):
+ return "Description"
+
class JobSubmit(Task):
def __init__(self, app):
super(JobSubmit, self).__init__(app)
@@ -117,8 +132,8 @@
ad = dict()
ad["Submission"] = description
+ ad["Owner"] = invoc.user.name
ad["Cmd"] = executable
- ad["Owner"] = invoc.user.name
def put(name, value):
if value:
@@ -153,10 +168,7 @@
self.pool_name = Attribute(app, "pool")
self.add_attribute(self.pool_name)
- self.description = self.DescriptionField(app, "description")
- self.description.input.size = 50
- self.description.required = True
- self.description.help = "This text will identify the submission"
+ self.description = JobDescriptionField(app, "description")
self.add_field(self.description)
self.command = self.CommandField(app, "command")
@@ -326,10 +338,6 @@
def render_item_content(self, session, item):
return item
- class DescriptionField(StringField):
- def render_title(self, session):
- return "Description"
-
class CommandField(MultilineStringField):
def render_title(self, session):
return "Command"
@@ -411,93 +419,112 @@
def render_title(self, session):
return "Extra attributes"
-# class SubmissionVMAdd(SubmissionAdd):
-# def get_add_form(self, app):
-# return SubmissionAddVMForm(app, self.name, self)
+class VmJobSubmit(Task):
+ def __init__(self, app):
+ super(VmJobSubmit, self).__init__(app)
-# def get_title(self, session):
-# return "Create VM submission"
+ self.form = VmJobSubmitForm(app, self.name, self)
-# def do_invoke(self, invoc, scheduler,
-# description,
-# executable,
-# arguments=None,
-# requirements=None,
-# universe=None,
-# iwd=None,
-# stdin=None,
-# stdout=None,
-# stderr=None,
-# usrlog=None,
-# attrs={}):
+ def get_title(self, session, scheduler):
+ return "Submit VM job"
-# cmd = "%s %s" % (executable, arguments)
-# arguments = None
-# super(SubmissionVMAdd, self).do_invoke(invoc, scheduler,
-# description, cmd, arguments,
-# requirements, universe, iwd,
-# stdin, stdout, stderr, usrlog,
-# attrs)
+ def do_invoke(self, session, scheduler, invoc,
+ description, image, memory):
+ ad = dict()
-# class SubmissionAddVMForm(SubmissionAddForm):
-# def add_fields(self, app):
-# self.disk = self.DiskField(app, "disk")
-# self.disk.input.size = 50
-# self.disk.required = True
-# self.disk.help = "VM disk img file location"
-# self.add_field(self.disk)
+ # General
-# self.requirements = self.RequirementsField(app, "requirements")
-# self.requirements.input.columns = 50
-# self.requirements.required = True
-# self.requirements.help = "Attributes controlling where and when " + \
-# "this submission will run"
-# self.add_field(self.requirements)
+ ad["Submission"] = description
+ ad["Owner"] = invoc.user.name
+ ad["Cmd"] = image # This is just an identifier in this context
+ ad["Iwd"] = "/tmp"
+ ad["ShouldTransferFiles"] = "NEVER" # try submit without
+ ad["RequestMemory"] = \
+ "ceiling(ifThenElse(JobVMMemory =!= undefined," + \
+ "JobVMMemory, " + \
+ "ImageSize / 1024.000000))"
-# self.universe = Attribute(app, "universe")
-# self.universe.default = self.task.UNIVERSE["VM"]
-# self.add_attribute(self.universe)
+ # VM
-# self.attributes_ = self.VMAttributes(app, "attributes")
-# self.add_attribute(self.attributes_)
+ ad["VMPARAM_Kvm_Disk"] = "%s:vda:w" % image
+ ad["JobVMType"] = "kvm"
+ ad["JobVMMemory"] = memory
+ ad["JobVM_VCPUS"] = 1
+ ad["JobVMNetworking"] = False
+ ad["JobVMCheckpoint"] = False
+ ad["JobVMMemory"] = memory
+ ad["JobVMMemory"] = memory
+
+ # Requirements
-# self.command = Attribute(app, "command")
-# self.command.default = "QMF Submitted VM"
-# self.add_attribute(self.command)
+ exprs = list()
+
+ exprs.append('VM_Type == "KVM"')
+ exprs.append('Arch == "X86_64"') # parameterize
+ exprs.append('HasVM')
+ exprs.append('VM_AvailNum > 0')
+ exprs.append('TotalDisk >= DiskUsage')
+ exprs.append('TotalMemory >= %i' % memory)
+ exprs.append('VM_Memory >= %i' % memory)
-# self.directory = Attribute(app, "directory")
-# self.directory.default = "/tmp"
-# self.add_attribute(self.directory)
+ # needs further consideration
+ #exprs.append('TARGET.FileSystemDomain == MY.FileSystemDomain')
-# self.stdin = Attribute(app, "stdin")
-# self.add_attribute(self.stdin)
+ ad["Requirements"] = " && ".join(exprs)
-# self.stdout = Attribute(app, "stdout")
-# self.add_attribute(self.stdout)
+ # Descriptors
-# self.stderr = Attribute(app, "stderr")
-# self.add_attribute(self.stderr)
+ descriptors = dict()
+ descriptors["Requirements"] = "com.redhat.grid.Expression"
-# self.usrlog = Attribute(app, "usrlog")
-# self.add_attribute(self.usrlog)
+ ad["!!descriptors"] = descriptors
-# class DiskField(StringField):
-# def render_title(self, session):
-# return "Disk"
+ invoc.description = "Submit VM job '%s'" % description
-# class VMAttributes(Attribute):
-# def get(self, session):
-# vm_ads = list()
-# vm_ads.append("ShouldTransferFiles=NEVER")
-# vm_ads.append("JobVMType=kvm")
-# vm_ads.append("JobVMMemory=512")
-# vm_ads.append("VMPARAM_Xen_Kernel=included")
+ self.qmf_call(invoc, scheduler, "SubmitJob", ad)
-# disk = self.widget.disk.get(session)
-# vm_ads.append("VMPARAM_Xen_Disk=%s:hda:w" % disk)
+class VmJobSubmitForm(ObjectTaskForm):
+ def __init__(self, app, name, task):
+ cls = app.model.com_redhat_grid.Scheduler
+ super(VmJobSubmitForm, self).__init__(app, name, task, cls)
-# return "\n".join(vm_ads)
+ self.pool_name = Attribute(app, "pool")
+ self.add_attribute(self.pool_name)
+ self.description = JobDescriptionField(app, "description")
+ self.add_field(self.description)
+
+ self.image = self.ImageField(app, "image")
+ self.image.input.size = 50
+ self.image.required = True
+ self.add_field(self.image)
+
+ from scheduler import SchedulerSelectField # XXX
+
+ self.scheduler = SchedulerSelectField(app, "scheduler", self.pool_name)
+ self.scheduler.help = "Submit job to this schedd"
+ self.add_extra_field(self.scheduler)
+
+ def process_submit(self, session):
+ self.validate(session)
+
+ if not self.errors.get(session):
+ scheduler = self.scheduler.get(session)
+ description = self.description.get(session)
+ image = self.image.get(session)
+
+ self.task.invoke(session,
+ scheduler,
+ description,
+ image,
+ 512)
+
+ self.task.exit_with_redirect(session, scheduler)
+
+ class ImageField(StringField):
+ def render_title(self, session):
+ return "Image location"
+
# class SubmissionDagAdd(SubmissionAdd):
# def __init__(self, app, frame):
# super(SubmissionDagAdd, self).__init__(app, frame)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-08-12 21:21:44 UTC (rev 4206)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-08-12 21:44:33 UTC (rev 4207)
@@ -73,6 +73,9 @@
link = TaskLink(app, "job_submit", app.grid.job_submit)
self.add_child(link)
+ link = TaskLink(app, "vm_job_submit", app.grid.vm_job_submit)
+ self.add_child(link)
+
# XXX
# task = SubmissionVMAdd(app)
# self.vm_link = ObjectTaskLink(app, "submissionvmadd", task)
@@ -109,9 +112,12 @@
col = ObjectLinkColumn(app, "name", self.cls.Name, self.cls._id, frame)
self.insert_column(1, col)
- link = TaskLink(app, "add", app.grid.job_submit)
+ link = TaskLink(app, "job_submit", app.grid.job_submit)
self.links.add_child(link)
+ link = TaskLink(app, "vm_job_submit", app.grid.vm_job_submit)
+ self.links.add_child(link)
+
class UserJobStatSet(NewStatSet):
def __init__(self, app, name, user):
super(UserJobStatSet, self).__init__(app, name)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-08-12 21:21:44 UTC (rev 4206)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-08-12 21:44:33 UTC (rev 4207)
@@ -36,6 +36,7 @@
<ul style="list-style-type: none; margin: 1 0; padding: 0;">
<li>{job_submit}</li>
+ <li>{vm_job_submit}</li>
</ul>
</td>
</tr>
14 years, 4 months