rhmessaging commits: r3547 - store/trunk/java/bdbstore.
by rhmessaging-commits@lists.jboss.org
Author: ritchiem
Date: 2009-08-07 05:55:43 -0400 (Fri, 07 Aug 2009)
New Revision: 3547
Added:
store/trunk/java/bdbstore/0.5-release/
Log:
Copied 0.5-release code base back to trunk to mirror changes done on Apache
Copied: store/trunk/java/bdbstore/0.5-release (from rev 3546, store/branches/java/0.5-release)
15 years, 4 months
rhmessaging commits: r3546 - store/trunk/cpp/rhel4-support.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-08-05 15:47:33 -0400 (Wed, 05 Aug 2009)
New Revision: 3546
Modified:
store/trunk/cpp/rhel4-support/rhel4.patch
Log:
Revised RHEL4 patch
Modified: store/trunk/cpp/rhel4-support/rhel4.patch
===================================================================
--- store/trunk/cpp/rhel4-support/rhel4.patch 2009-08-05 17:48:12 UTC (rev 3545)
+++ store/trunk/cpp/rhel4-support/rhel4.patch 2009-08-05 19:47:33 UTC (rev 3546)
@@ -1,6 +1,6 @@
Index: tests/.valgrind.supp
===================================================================
---- tests/.valgrind.supp (revision 3519)
+--- tests/.valgrind.supp (revision 3545)
+++ tests/.valgrind.supp (working copy)
@@ -1,33 +1,74 @@
{
@@ -102,17 +102,17 @@
Index: configure.ac
===================================================================
---- configure.ac (revision 3413)
+--- configure.ac (revision 3545)
+++ configure.ac (working copy)
-@@ -54,7 +54,6 @@
+@@ -62,7 +62,6 @@
# -Wshadow - warns about boost headers.
- if test "${enableval}" = yes; then
+ if test "$enable_WARNINGS" = yes; then
- gl_COMPILER_FLAGS(-Werror)
gl_COMPILER_FLAGS(-pedantic)
gl_COMPILER_FLAGS(-Wall)
gl_COMPILER_FLAGS(-Wextra)
-@@ -63,7 +62,6 @@
+@@ -71,7 +70,6 @@
gl_COMPILER_FLAGS(-Wcast-qual)
gl_COMPILER_FLAGS(-Wcast-align)
gl_COMPILER_FLAGS(-Wno-long-long)
@@ -122,9 +122,9 @@
AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS])
Index: lib/MessageStoreImpl.cpp
===================================================================
---- lib/MessageStoreImpl.cpp (revision 3413)
+--- lib/MessageStoreImpl.cpp (revision 3545)
+++ lib/MessageStoreImpl.cpp (working copy)
-@@ -304,10 +304,6 @@
+@@ -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) {
@@ -134,3 +134,4 @@
- "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);
}
+
15 years, 5 months
rhmessaging commits: r3545 - in store/trunk/cpp: tests and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-08-05 13:48:12 -0400 (Wed, 05 Aug 2009)
New Revision: 3545
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
store/trunk/cpp/tests/Makefile.am
store/trunk/cpp/tests/OrderingTest.cpp
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/TransactionalTest.cpp
store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
Log:
Completed truncate tidy-up, and added a --truncate option to the store.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-08-05 13:53:56 UTC (rev 3544)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-08-05 17:48:12 UTC (rev 3545)
@@ -33,7 +33,7 @@
#include <dirent.h>
#define MAX_AIO_SLEEPS 1000 // ~1 second
-#define AIO_SLEEP_TIME 1000 // 1 milisecond
+#define AIO_SLEEP_TIME 1000 // 1 Millisecond
using namespace mrg::msgstore;
using namespace qpid::broker;
@@ -47,8 +47,7 @@
using qpid::management::ManagementAgent;
namespace _qmf = qmf::com::redhat::rhm::store;
-static const u_int8_t MESSAGE_MESSAGE = 1;
-static const u_int8_t BASIC_MESSAGE = 2;
+const std::string MessageStoreImpl::storeTopLevelDir("rhm"); // Sets the top-level store dir name
qpid::sys::Duration MessageStoreImpl::defJournalGetEventsTimeout(10 * qpid::sys::TIME_MSEC); // 10ms
qpid::sys::Duration MessageStoreImpl::defJournalFlushTimeout(500 * qpid::sys::TIME_MSEC); // 0.5s
qpid::sys::Mutex TxnCtxt::globalSerialiser;
@@ -68,6 +67,7 @@
autoJrnlExpand(false),
autoJrnlExpandMaxFiles(0),
jrnlFsizeSblks(0),
+ truncateFlag(false),
wCachePgSizeSblks(0),
wCacheNumPages(0),
tplNumJrnlFiles(0),
@@ -253,13 +253,14 @@
chkJrnlAutoExpandOptions(opts, autoJrnlExpand, autoJrnlExpandMaxFiles, "auto-expand-max-jfiles", numJrnlFiles, "num-jfiles");
// Pass option values to init(...)
- return init(opts->storeDir, numJrnlFiles, jrnlFsizePgs, jrnlWrCachePageSizeKib, tplNumJrnlFiles, tplJrnlFSizePgs, tplJrnlWrCachePageSizeKib, autoJrnlExpand, autoJrnlExpandMaxFiles);
+ return init(opts->storeDir, numJrnlFiles, jrnlFsizePgs, opts->truncateFlag, jrnlWrCachePageSizeKib, tplNumJrnlFiles, tplJrnlFSizePgs, tplJrnlWrCachePageSizeKib, autoJrnlExpand, autoJrnlExpandMaxFiles);
}
// These params, taken from options, are assumed to be correct and verified
bool MessageStoreImpl::init(const std::string& dir,
u_int16_t jfiles,
u_int32_t jfileSizePgs,
+ const bool truncateFlag,
u_int32_t wCachePageSizeKib,
u_int16_t tplJfiles,
u_int32_t tplJfileSizePgs,
@@ -282,7 +283,10 @@
autoJrnlExpandMaxFiles = autoJExpandMaxFiles;
if (dir.size()>0) storeDir = dir;
- init();
+ if (truncateFlag)
+ truncateInit(false);
+ else
+ init();
QPID_LOG(notice, "Store module initialized; dir=" << dir);
QPID_LOG(info, "> Default files per journal: " << jfiles);
@@ -339,7 +343,6 @@
open(bindingDb, txn.get(), "bindings.db", true);
open(generalDb, txn.get(), "general.db", false);
tplStorePtr.reset(new TplJournalImpl("TplStore", getTplBaseDir(), "tpl", defJournalGetEventsTimeout, defJournalFlushTimeout, agent));
- journalList["TplStore"]=tplStorePtr.get();
txn.commit();
} catch (const journal::jexception& e) {
txn.abort();
@@ -357,6 +360,7 @@
void MessageStoreImpl::finalize()
{
+ if (tplStorePtr->is_ready()) tplStorePtr->stop(true);
for (JournalListMapItr i = journalList.begin(); i != journalList.end(); i++)
{
JournalImpl* jQueue = i->second;
@@ -391,21 +395,30 @@
}
}
-void MessageStoreImpl::discardInit(const bool pushDownStoreFiles)
+void MessageStoreImpl::truncateInit(const bool pushDownStoreFiles)
{
if (isInit) {
+ if (journalList.size()) { // check no queues exist
+ std::ostringstream oss;
+ oss << "truncateInit() called with " << journalList.size() << " queues still in existence";
+ THROW_STORE_EXCEPTION(oss.str());
+ }
for (std::list<db_ptr >::iterator i = dbs.begin(); i != dbs.end(); i++) {
(*i)->close(0);
}
dbs.clear();
if (tplStorePtr->is_ready()) tplStorePtr->stop(true);
dbenv->close(0);
- if (pushDownStoreFiles)
- pushDown(storeDir.c_str(), "cluster_bak");
- else
- mrg::journal::jdir::delete_dir(storeDir.c_str());
- init();
}
+ if (pushDownStoreFiles)
+ pushDown(storeDir.c_str(), "cluster_bak");
+ else {
+ QPID_LOG(notice, "Store in " << storeDir << " truncated.");
+ std::ostringstream oss;
+ oss << storeDir << "/" << storeTopLevelDir;
+ mrg::journal::jdir::delete_dir(oss.str().c_str());
+ }
+ init();
}
void MessageStoreImpl::chkTplStoreInit()
@@ -451,19 +464,6 @@
mgmtObject->resourceDestroy();
}
-void MessageStoreImpl::truncate()
-{
- DbTxn* txn;
- dbenv->txn_begin(0, &txn, 0);
- u_int32_t count;
-
- for (std::list<db_ptr >::iterator i = dbs.begin(); i != dbs.end(); i++) {
- (*i)->truncate(txn, &count, 0);
- }
-
- txn->commit(0);
-}
-
void MessageStoreImpl::create(PersistableQueue& queue,
const FieldTable& args)
{
@@ -1815,22 +1815,22 @@
std::string MessageStoreImpl::getJrnlBaseDir()
{
- std::stringstream dir;
- dir << storeDir << "/rhm/jrnl/" ;
+ std::ostringstream dir;
+ dir << storeDir << "/" << storeTopLevelDir << "/jrnl/" ;
return dir.str();
}
std::string MessageStoreImpl::getBdbBaseDir()
{
- std::stringstream dir;
- dir << storeDir << "/rhm/dat/" ;
+ std::ostringstream dir;
+ dir << storeDir << "/" << storeTopLevelDir << "/dat/" ;
return dir.str();
}
std::string MessageStoreImpl::getTplBaseDir()
{
- std::stringstream dir;
- dir << storeDir << "/rhm/tpl/" ;
+ std::ostringstream dir;
+ dir << storeDir << "/" << storeTopLevelDir << "/tpl/" ;
return dir.str();
}
@@ -1863,6 +1863,7 @@
autoJrnlExpand(defAutoJrnlExpand),
autoJrnlExpandMaxFiles(defAutoJrnlExpandMaxFiles),
jrnlFsizePgs(defJrnlFileSizePgs),
+ truncateFlag(defTruncateFlag),
wCachePageSizeKib(defWCachePageSize),
tplNumJrnlFiles(defTplNumJrnlFiles),
tplJrnlFsizePgs(defTplJrnlFileSizePgs),
@@ -1882,6 +1883,9 @@
// "Maximum number of journal files allowed from auto-expanding; must be greater than --num-jfiles parameter.")
("jfile-size-pgs", qpid::optValue(jrnlFsizePgs, "N"),
"Default size for each journal file in multiples of read pages (1 read page = 64kiB)")
+ ("truncate", qpid::optValue(truncateFlag, "yes|no"),
+ "If yes|true|1, will truncate the store (discard any existing records). If no|false|0, will preserve "
+ "the existing store files for recovery.")
("wcache-page-size", qpid::optValue(wCachePageSizeKib, "N"),
"Size of the pages in the write page cache in KiB. "
"Allowable values - powers of 2: 1, 2, 4, ... , 128. "
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2009-08-05 13:53:56 UTC (rev 3544)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2009-08-05 17:48:12 UTC (rev 3545)
@@ -65,6 +65,7 @@
bool autoJrnlExpand;
u_int16_t autoJrnlExpandMaxFiles;
u_int32_t jrnlFsizePgs;
+ bool truncateFlag;
u_int32_t wCachePageSizeKib;
u_int16_t tplNumJrnlFiles;
u_int32_t tplJrnlFsizePgs;
@@ -99,6 +100,7 @@
// Default store settings
static const u_int16_t defNumJrnlFiles = 8;
static const u_int32_t defJrnlFileSizePgs = 24;
+ static const bool defTruncateFlag = false;
static const u_int32_t defWCachePageSize = JRNL_WMGR_DEF_PAGE_SIZE * JRNL_DBLK_SIZE * JRNL_SBLK_SIZE / 1024;
static const u_int16_t defTplNumJrnlFiles = 8;
static const u_int32_t defTplJrnlFileSizePgs = 24;
@@ -107,6 +109,10 @@
static const bool defAutoJrnlExpand = false;
static const u_int16_t defAutoJrnlExpandMaxFiles = 0;
+ static const std::string storeTopLevelDir;
+ static qpid::sys::Duration defJournalGetEventsTimeout;
+ static qpid::sys::Duration defJournalFlushTimeout;
+
std::list<db_ptr> dbs;
dbEnv_ptr dbenv;
db_ptr queueDb;
@@ -131,6 +137,7 @@
bool autoJrnlExpand;
u_int16_t autoJrnlExpandMaxFiles;
u_int32_t jrnlFsizeSblks;
+ bool truncateFlag;
u_int32_t wCachePgSizeSblks;
u_int16_t wCacheNumPages;
u_int16_t tplNumJrnlFiles;
@@ -140,8 +147,6 @@
u_int64_t highestRid;
bool isInit;
const char* envPath;
- static qpid::sys::Duration defJournalGetEventsTimeout;
- static qpid::sys::Duration defJournalFlushTimeout;
qmf::com::redhat::rhm::store::Store* mgmtObject;
qpid::sys::Mutex jrnlCreateLock;
@@ -292,6 +297,7 @@
bool init(const std::string& dir,
u_int16_t jfiles = defNumJrnlFiles,
u_int32_t jfileSizePgs = defJrnlFileSizePgs,
+ const bool truncateFlag = false,
u_int32_t wCachePageSize = defWCachePageSize,
u_int16_t tplJfiles = defTplNumJrnlFiles,
u_int32_t tplJfileSizePgs = defTplJrnlFileSizePgs,
@@ -299,14 +305,12 @@
bool autoJExpand = defAutoJrnlExpand,
u_int16_t autoJExpandMaxFiles = defAutoJrnlExpandMaxFiles);
- void discardInit(const bool pushDownStoreFiles = false);
+ void truncateInit(const bool pushDownStoreFiles = false);
void initManagement (qpid::broker::Broker* broker);
void finalize();
- void truncate();
-
void create(qpid::broker::PersistableQueue& queue,
const qpid::framing::FieldTable& args);
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-08-05 13:53:56 UTC (rev 3544)
+++ store/trunk/cpp/tests/Makefile.am 2009-08-05 17:48:12 UTC (rev 3545)
@@ -29,7 +29,7 @@
TMP_DATA_DIR=$(abs_srcdir)/tmp_data_dir
if DO_CLUSTER_TESTS
-SUBDIRS = jrnl cluster .
+SUBDIRS = jrnl . cluster
else
SUBDIRS = jrnl .
endif
Modified: store/trunk/cpp/tests/OrderingTest.cpp
===================================================================
--- store/trunk/cpp/tests/OrderingTest.cpp 2009-08-05 13:53:56 UTC (rev 3544)
+++ store/trunk/cpp/tests/OrderingTest.cpp 2009-08-05 17:48:12 UTC (rev 3545)
@@ -60,8 +60,7 @@
void setup()
{
store = std::auto_ptr<MessageStoreImpl>(new MessageStoreImpl());
- store->init(test_dir, 4, 1, 8);
- store->truncate();
+ store->init(test_dir, 4, 1, true); // truncate store
queue = Queue::shared_ptr(new Queue(name, 0, store.get(), 0));
FieldTable settings;
@@ -100,7 +99,7 @@
store.reset();
store = std::auto_ptr<MessageStoreImpl>(new MessageStoreImpl());
- store->init(test_dir, 4, 1, 8);
+ store->init(test_dir, 4, 1);
ExchangeRegistry exchanges;
LinkRegistry links;
sys::Timer t;
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2009-08-05 13:53:56 UTC (rev 3544)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2009-08-05 17:48:12 UTC (rev 3545)
@@ -93,8 +93,7 @@
{
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
Exchange::shared_ptr exchange(new DirectExchange(exchangeName, true, args));
Queue::shared_ptr queue(new Queue(queueName, 0, &store, 0));
store.create(*exchange, qpid::framing::FieldTable());
@@ -104,7 +103,7 @@
}//db will be closed
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
ExchangeRegistry exchanges;
QueueRegistry queues;
LinkRegistry links;
@@ -119,7 +118,7 @@
}
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
ExchangeRegistry exchanges;
QueueRegistry queues;
LinkRegistry links;
@@ -142,8 +141,7 @@
cout << test_filename << ".CreateDelete: " << flush;
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
string name("CreateDeleteQueue");
Queue queue(name, 0, &store, 0);
store.create(queue, qpid::framing::FieldTable());
@@ -159,8 +157,7 @@
{
cout << test_filename << ".EmptyRecover: " << flush;
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
QueueRegistry registry;
registry.setStore (&store);
recover(store, registry);
@@ -177,8 +174,7 @@
string name("MyDurableQueue");
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
Queue queue(name, 0, &store, 0);
store.create(queue, qpid::framing::FieldTable());
BOOST_REQUIRE(queue.getPersistenceId());
@@ -186,7 +182,7 @@
}//db will be closed
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
QueueRegistry registry;
registry.setStore (&store);
recover(store, registry);
@@ -206,8 +202,7 @@
string name("MyDurableQueue");
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
Queue queue(name, 0, &store, 0);
FieldTable settings;
policy->update(settings);
@@ -216,7 +211,7 @@
}//db will be closed
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
QueueRegistry registry;
registry.setStore (&store);
recover(store, registry);
@@ -237,15 +232,14 @@
string name("MyDurableQueue");
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
Queue queue(name, 0, &store, 0);
store.create(queue, qpid::framing::FieldTable());
store.destroy(queue);
}//db will be closed
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
QueueRegistry registry;
registry.setStore (&store);
recover(store, registry);
@@ -271,8 +265,7 @@
string data2("hijklmn");
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
Queue::shared_ptr queue(new Queue(name, 0, &store, 0));
FieldTable settings;
queue->create(settings);
@@ -290,7 +283,7 @@
}//db will be closed
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
QueueRegistry registry;
registry.setStore (&store);
recover(store, registry);
@@ -331,8 +324,7 @@
Uuid messageId(true);
string data("abcdefg");
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
Queue::shared_ptr queue(new Queue(name, 0, &store, 0));
FieldTable settings;
queue->create(settings);
@@ -348,7 +340,7 @@
}//db will be closed
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
QueueRegistry registry;
registry.setStore (&store);
recover(store, registry);
@@ -372,8 +364,7 @@
const string data2("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
//create & stage a message
boost::intrusive_ptr<Message> msg = MessageUtils::createMessage(exchange, routingKey, messageId, (data1.size() + data2.size()));
@@ -414,7 +405,7 @@
{
//recover
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
QueueRegistry registry;
registry.setStore (&store);
ExchangeRegistry exchanges;
@@ -468,8 +459,7 @@
cout << test_filename << ".DestroyStagedMessage: " << flush;
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
const string data("abcdefg");
boost::intrusive_ptr<Message> msg(MessageUtils::createMessage("my_exchange", "my_routing_key", "my_message", data.length()));
@@ -496,8 +486,7 @@
cout << test_filename << ".DestroyEnqueuedMessage: " << flush;
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
const string data("abcdefg");
boost::intrusive_ptr<Message> msg(MessageUtils::createMessage("my_exchange", "my_routing_key", "my_message", data.length()));
@@ -532,8 +521,7 @@
args.setString("a", "A");
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
ExchangeRegistry registry;
Exchange::shared_ptr exchange = registry.declare(name, type, true, args).first;
store.create(*exchange, qpid::framing::FieldTable());
@@ -542,7 +530,7 @@
}//db will be closed
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
ExchangeRegistry registry;
recover(store, registry);
@@ -556,7 +544,7 @@
}
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
ExchangeRegistry registry;
recover(store, registry);
@@ -604,8 +592,7 @@
FieldTable args;
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
- store.truncate();//make sure it is empty to begin with
+ store.init(test_dir, 4, 1, true); // truncate store
Exchange::shared_ptr exchange(new DirectExchange(exchangeName, true, args));
Queue::shared_ptr queue1(new Queue(queueName1, 0, &store, 0));
Queue::shared_ptr queue2(new Queue(queueName2, 0, &store, 0));
@@ -619,7 +606,7 @@
}//db will be closed
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
ExchangeRegistry exchanges;
QueueRegistry queues;
LinkRegistry links;
@@ -636,7 +623,7 @@
}
{
MessageStoreImpl store;
- store.init(test_dir, 4, 1, 8);
+ store.init(test_dir, 4, 1);
ExchangeRegistry exchanges;
QueueRegistry queues;
LinkRegistry links;
Modified: store/trunk/cpp/tests/TransactionalTest.cpp
===================================================================
--- store/trunk/cpp/tests/TransactionalTest.cpp 2009-08-05 13:53:56 UTC (rev 3544)
+++ store/trunk/cpp/tests/TransactionalTest.cpp 2009-08-05 17:48:12 UTC (rev 3545)
@@ -109,8 +109,7 @@
void setup()
{
store = std::auto_ptr<T>(new T());
- store->init(test_dir, 4, 1, 8);
- store->truncate();
+ store->init(test_dir, 4, 1, true); // truncate store
//create two queues:
FieldTable settings;
@@ -129,7 +128,7 @@
store.reset();
store = std::auto_ptr<T>(new T());
- store->init(test_dir, 4, 1, 8);
+ store->init(test_dir, 4, 1);
queues = std::auto_ptr<QueueRegistry>(new QueueRegistry);
ExchangeRegistry exchanges;
LinkRegistry links;
Modified: store/trunk/cpp/tests/TwoPhaseCommitTest.cpp
===================================================================
--- store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2009-08-05 13:53:56 UTC (rev 3544)
+++ store/trunk/cpp/tests/TwoPhaseCommitTest.cpp 2009-08-05 17:48:12 UTC (rev 3545)
@@ -326,8 +326,7 @@
void setup()
{
store = std::auto_ptr<T>(new T());
- store->init(test_dir, 4, 1, 8);
- store->truncate();
+ store->init(test_dir, 4, 1, true); // truncate store
//create two queues:
FieldTable settings;
@@ -355,7 +354,7 @@
links.reset();
store = std::auto_ptr<T>(new T());
- store->init(test_dir, 4, 1, 8);
+ store->init(test_dir, 4, 1);
sys::Timer t;
ExchangeRegistry exchanges;
queues = std::auto_ptr<QueueRegistry>(new QueueRegistry);
15 years, 5 months
rhmessaging commits: r3544 - mgmt/trunk/wooly/python/wooly.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-08-05 09:53:56 -0400 (Wed, 05 Aug 2009)
New Revision: 3544
Modified:
mgmt/trunk/wooly/python/wooly/forms.py
Log:
Rename button vars to avoid collision with submit and cancel methods
Modified: mgmt/trunk/wooly/python/wooly/forms.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/forms.py 2009-08-05 13:50:07 UTC (rev 3543)
+++ mgmt/trunk/wooly/python/wooly/forms.py 2009-08-05 13:53:56 UTC (rev 3544)
@@ -526,30 +526,30 @@
self.return_url = Parameter(app, "return")
self.add_parameter(self.return_url)
- self.cancel = self.Cancel(app, "cancel")
- self.cancel.set_tab_index(201)
- self.add_button(self.cancel)
+ self.cancel_button = self.Cancel(app, "cancel")
+ self.cancel_button.set_tab_index(201)
+ self.add_button(self.cancel_button)
- self.submit = self.Submit(app, "submit")
- self.submit.set_tab_index(200)
- self.add_button(self.submit)
+ self.submit_button = self.Submit(app, "submit")
+ self.submit_button.set_tab_index(200)
+ self.add_button(self.submit_button)
def submit(self, session):
- self.submit.set(session, True)
+ self.submit_button.set(session, True)
def cancel(self, session):
- self.cancel.set(session, True)
+ self.cancel_button.set(session, True)
def check(self, session):
pass
def do_process(self, session):
- if self.cancel.get(session):
- self.cancel.set(session, False)
+ if self.cancel_button.get(session):
+ self.cancel_button.set(session, False)
self.process_cancel(session)
- elif self.submit.get(session):
- self.submit.set(session, False)
+ elif self.submit_button.get(session):
+ self.submit_button.set(session, False)
self.process_submit(session)
else:
15 years, 5 months
rhmessaging commits: r3543 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-08-05 09:50:07 -0400 (Wed, 05 Aug 2009)
New Revision: 3543
Modified:
mgmt/trunk/cumin/python/cumin/model.py
Log:
* Add logging for task events
* Check that we have a user_session before accessing it for a task
invocation
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2009-08-05 13:45:25 UTC (rev 3542)
+++ mgmt/trunk/cumin/python/cumin/model.py 2009-08-05 13:50:07 UTC (rev 3543)
@@ -189,6 +189,8 @@
return self.enter(session, object).marshal()
def enter(self, session, object):
+ log.debug("Entering %s", self)
+
nsession = wooly.Session(self.app.form_page)
self.form.return_url.set(nsession, session.marshal())
@@ -196,6 +198,8 @@
self.do_enter(nsession, object)
+ log.info("Entered %s", self)
+
return nsession
def do_enter(self, session, object):
@@ -206,11 +210,15 @@
self.form.page.set_redirect_url(session, osession.marshal())
def exit(self, session, object):
+ log.debug("Exiting %s", self)
+
url = self.form.return_url.get(session)
osession = wooly.Session.unmarshal(self.app, url)
self.do_exit(osession, object)
+ log.info("Exited %s", self)
+
return osession
def do_exit(self, session, object):
@@ -230,9 +238,14 @@
raise Exception("Not implemented")
def start(self, session, object):
+ log.debug("Starting %s", self)
+
now = datetime.now()
- subject = session.user_session.subject
+ subject = None
+ if hasattr(session, "user_session"):
+ subject = session.user_session.subject
+
invoc = TaskInvocation(self, subject, object)
invoc.status = invoc.PENDING
invoc.start_time = now
@@ -240,15 +253,21 @@
self.app.model.task_invocations.append(invoc)
+ log.info("Started %s", self)
+
return invoc
def end(self, invoc):
+ log.debug("Ending %s", self)
+
now = datetime.now()
invoc.status = invoc.OK
invoc.end_time = now
invoc.last_change_time = now
+ log.info("Ended %s", self)
+
def exception(self, invoc, e):
now = datetime.now()
15 years, 5 months
rhmessaging commits: r3542 - mgmt/trunk/cumin/python/cumin.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-08-05 09:45:25 -0400 (Wed, 05 Aug 2009)
New Revision: 3542
Modified:
mgmt/trunk/cumin/python/cumin/main.py
Log:
For now, use mint's idea of the configured brokers
Modified: mgmt/trunk/cumin/python/cumin/main.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/main.py 2009-08-05 13:43:36 UTC (rev 3541)
+++ mgmt/trunk/cumin/python/cumin/main.py 2009-08-05 13:45:25 UTC (rev 3542)
@@ -206,7 +206,7 @@
class ManagementServerNotice(Widget):
def do_render(self, session):
- count = BrokerRegistration.select().count()
+ count = len(self.app.model.mint.model.mintBrokersByUrl)
if count == 0:
return super(OverviewView.ManagementServerNotice,
15 years, 5 months
rhmessaging commits: r3541 - mgmt/trunk.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-08-05 09:43:36 -0400 (Wed, 05 Aug 2009)
New Revision: 3541
Modified:
mgmt/trunk/Makefile
Log:
Add trailing slashes so we dereference symlinks
Modified: mgmt/trunk/Makefile
===================================================================
--- mgmt/trunk/Makefile 2009-08-05 13:42:43 UTC (rev 3540)
+++ mgmt/trunk/Makefile 2009-08-05 13:43:36 UTC (rev 3541)
@@ -8,9 +8,9 @@
@echo " tags Rebuild the tag index"
tags: check-devel-env
- find "${DEVEL_HOME}" -name \*.py -print \
+ find "${DEVEL_HOME}/" -name \*.py -print \
| etags --output="${DEVEL_HOME}/etc/devel.tags" -
- find "${DEVEL_HOME}" -name \*.strings -print \
+ find "${DEVEL_HOME}/" -name \*.strings -print \
| etags --append --output="${DEVEL_HOME}/etc/devel.tags" \
--regex='/^\[.*\][ \t]*$$/\1/' -
15 years, 5 months
rhmessaging commits: r3540 - mgmt/trunk/cumin/python/cumin/messaging.
by rhmessaging-commits@lists.jboss.org
Author: justi9
Date: 2009-08-05 09:42:43 -0400 (Wed, 05 Aug 2009)
New Revision: 3540
Modified:
mgmt/trunk/cumin/python/cumin/messaging/exchange.py
Log:
Use get_description for title
Modified: mgmt/trunk/cumin/python/cumin/messaging/exchange.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/messaging/exchange.py 2009-08-04 20:07:22 UTC (rev 3539)
+++ mgmt/trunk/cumin/python/cumin/messaging/exchange.py 2009-08-05 13:42:43 UTC (rev 3540)
@@ -284,7 +284,7 @@
def render_title(self, session):
vhost = self.vhost.get(session)
- return self.task.get_title(session, vhost)
+ return self.task.get_description(session, vhost)
class SequenceField(TwoOptionRadioField):
def render_title(self, session):
15 years, 5 months
rhmessaging commits: r3539 - in store/trunk/cpp: lib/jrnl and 1 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2009-08-04 16:07:22 -0400 (Tue, 04 Aug 2009)
New Revision: 3539
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/jrnl/jcntl.cpp
store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
Log:
Second fix which addresses the NFS errors in some tests. This fix now allows all tests to complete on an NFS mounted data-dir (although this is not a good idea from a performance perspective)
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-08-04 18:43:19 UTC (rev 3538)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2009-08-04 20:07:22 UTC (rev 3539)
@@ -462,13 +462,6 @@
}
txn->commit(0);
- try {
- journal::jdir::delete_dir(getJrnlBaseDir(),true);
- journal::jdir::delete_dir(getTplBaseDir(),true);
- }
- catch (const journal::jexception& e) {
- THROW_STORE_EXCEPTION(std::string("truncate() failed: ") + e.what() );
- }
}
void MessageStoreImpl::create(PersistableQueue& queue,
Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-08-04 18:43:19 UTC (rev 3538)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp 2009-08-04 20:07:22 UTC (rev 3539)
@@ -377,6 +377,7 @@
if (!_readonly_flag)
flush(block_till_aio_cmpl);
_rrfc.finalize();
+ _lpmgr.finalize();
}
u_int16_t
Modified: store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-08-04 18:43:19 UTC (rev 3538)
+++ store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-08-04 20:07:22 UTC (rev 3539)
@@ -151,6 +151,7 @@
lfm.get_pfid_list(pfidl);
lfm.get_lfid_list(lfidl);
+ lm.finalize(); // clear all file handles before erasing old journal files
lfm.write_journal(ae, ae_max_jfiles);
lpmgr_test_helper::rcvdat_init(rd, pfidl, ae, ae_max_jfiles);
@@ -230,23 +231,23 @@
const bool init_flag_1)
{
unsigned i_njf = 0;
- while (num_jfiles_arr[i_njf][0] && num_jfiles_arr[i_njf][1])
+ while (num_jfiles_arr[i_njf][0] && num_jfiles_arr[i_njf][1]) // cycle through each entry in num_jfiles_arr
{
- for (unsigned i1_njf = 0; i1_njf <= 1; i1_njf++)
+ for (unsigned i1_njf = 0; i1_njf <= 1; i1_njf++) // cycle through the two numbers in each entry of num_jfiles_arr
{
- const u_int16_t num_jfiles_0 = num_jfiles_arr[i_njf][i1_njf == 0];
- const u_int16_t num_jfiles_1 = num_jfiles_arr[i_njf][i1_njf != 0];
+ const u_int16_t num_jfiles_0 = num_jfiles_arr[i_njf][i1_njf == 0]; // first number in pair
+ const u_int16_t num_jfiles_1 = num_jfiles_arr[i_njf][i1_njf != 0]; // second number in pair
- for (unsigned i_ae = 0; i_ae < 4; i_ae++)
+ for (unsigned i_ae = 0; i_ae < 4; i_ae++) // cycle through combinations of enabling AE
{
- const bool ae_0 = i_ae & 0x1;
- const bool ae_1 = i_ae & 0x2;
- for (unsigned i_aemjf = 0; i_aemjf < 4; i_aemjf++)
+ const bool ae_0 = i_ae & 0x1; // first bit: enable AE on first init
+ const bool ae_1 = i_ae & 0x2; // second bit: enable AE on second init
+ for (unsigned i_aemjf = 0; i_aemjf < 4; i_aemjf++) // cycle through combinations of enabling/disabling ae limit
{
- const u_int16_t ae_max_jfiles_0 = i_aemjf & 0x1 ? 3 * num_jfiles_0 : 0;
- const u_int16_t ae_max_jfiles_1 = i_aemjf & 0x2 ? 4 * num_jfiles_1 : 0;
+ const u_int16_t ae_max_jfiles_0 = i_aemjf & 0x1 ? 3 * num_jfiles_0 : 0; // max ae files, 0 = disable max
+ const u_int16_t ae_max_jfiles_1 = i_aemjf & 0x2 ? 4 * num_jfiles_1 : 0; // max ae files, 0 = disable max
- lpmgr lm;
+ lpmgr lm; // DUT
if (init_flag_0)
initialize(lm, jc, num_jfiles_0, ae_0, ae_max_jfiles_0);
@@ -606,7 +607,7 @@
const bool i_0 = p & 0x01; // first bit
const bool i_1 = p & 0x02; // second bit
const bool f = p & 0x04; // third bit
- lpmgr_test_helper::check_multiple_initialization_recover(lfm, jc, num_jfiles_arr, i_0,f, i_1);
+ lpmgr_test_helper::check_multiple_initialization_recover(lfm, jc, num_jfiles_arr, i_0, f, i_1);
}
}
catch(const exception& e) { BOOST_FAIL(e.what()); }
15 years, 5 months
rhmessaging commits: r3538 - store/trunk/cpp/tests/cluster.
by rhmessaging-commits@lists.jboss.org
Author: aconway
Date: 2009-08-04 14:43:19 -0400 (Tue, 04 Aug 2009)
New Revision: 3538
Modified:
store/trunk/cpp/tests/cluster/run_cluster_tests
Log:
Fix paths to cluster tests in a vpath build.
Modified: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests 2009-08-04 14:11:24 UTC (rev 3537)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests 2009-08-04 18:43:19 UTC (rev 3538)
@@ -138,7 +138,7 @@
# Executables
CPP_CLUSTER_EXEC="${QPID_BLD}/src/tests/cluster_test"
- PYTHON_CLUSTER_EXEC="${QPID_BLD}/src/tests/$PYTHON_TESTNAME"
+ PYTHON_CLUSTER_EXEC="${QPID_DIR}/cpp/src/tests/$PYTHON_TESTNAME"
export QPIDD_EXEC="${QPID_BLD}/src/qpidd"
export QPID_CONFIG_EXEC="${QPID_DIR}/python/commands/qpid-config"
export QPID_ROUTE_EXEC="${QPID_DIR}/python/commands/qpid-route"
15 years, 5 months