rhmessaging commits: r3924 - store/trunk/java/bdbstore/bin.
by rhmessaging-commits@lists.jboss.org
Author: rgemmell
Date: 2010-04-22 11:03:17 -0400 (Thu, 22 Apr 2010)
New Revision: 3924
Modified:
store/trunk/java/bdbstore/bin/backup.sh
Log:
Updated bin/backup.sh to use dirname rather than readlink.
merged from java/0.5.x-dev r3909
Modified: store/trunk/java/bdbstore/bin/backup.sh
===================================================================
--- store/trunk/java/bdbstore/bin/backup.sh 2010-04-22 15:02:40 UTC (rev 3923)
+++ store/trunk/java/bdbstore/bin/backup.sh 2010-04-22 15:03:17 UTC (rev 3924)
@@ -27,10 +27,10 @@
fi
done
+WHEREAMI=`dirname $0`
if [ -z "$QPID_HOME" ]; then
- export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
+ export QPID_HOME=`cd $WHEREAMI/../ && pwd`
fi
-
VERSION=0.6
LIBS=$QPID_HOME/lib/qpid-bdbtools-$VERSION.jar:$QPID_HOME/lib/je-3.3.62.jar:$QPID_HOME/lib/qpid-bdbstore-$VERSION.jar:$QPID_HOME/lib/qpid-all.jar
14 years, 8 months
rhmessaging commits: r3923 - in store/trunk/java/bdbstore: bin and 1 other directory.
by rhmessaging-commits@lists.jboss.org
Author: rgemmell
Date: 2010-04-22 11:02:40 -0400 (Thu, 22 Apr 2010)
New Revision: 3923
Modified:
store/trunk/java/bdbstore/bin/backup.sh
store/trunk/java/bdbstore/build.xml
Log:
Update build system to include backup-log4j.xml and update backup.sh to use the standard VERSION=X convention to setup the libs.
merged from java/0.5.x-dev r3908
Modified: store/trunk/java/bdbstore/bin/backup.sh
===================================================================
--- store/trunk/java/bdbstore/bin/backup.sh 2010-04-22 15:02:02 UTC (rev 3922)
+++ store/trunk/java/bdbstore/bin/backup.sh 2010-04-22 15:02:40 UTC (rev 3923)
@@ -1,4 +1,22 @@
#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
# Parse arguments taking all - prefixed args as JAVA_OPTS
for arg in "$@"; do
@@ -11,14 +29,12 @@
if [ -z "$QPID_HOME" ]; then
export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
- export PATH=${PATH}:${QPID_HOME}/bin
fi
-if [ -z "$BDB_HOME" ]; then
- export BDB_HOME=$(dirname $(dirname $(readlink -f $0)))
-fi
+VERSION=0.6
-LIBS=$BDB_HOME/lib/qpid-bdbtools-M3.jar:$BDB_HOME/lib/je-3.3.62.jar:$BDB_HOME/lib/qpid-bdbstore-M3.jar:$QPID_HOME/lib/qpid-incubating.jar
+LIBS=$QPID_HOME/lib/qpid-bdbtools-$VERSION.jar:$QPID_HOME/lib/je-3.3.62.jar:$QPID_HOME/lib/qpid-bdbstore-$VERSION.jar:$QPID_HOME/lib/qpid-all.jar
+
echo "Starting Hot Backup Script"
java -Dlog4j.configuration=backup-log4j.xml ${JAVA_OPTS} -cp $LIBS org.apache.qpid.server.store.berkeleydb.BDBBackup ${ARGS}
Modified: store/trunk/java/bdbstore/build.xml
===================================================================
--- store/trunk/java/bdbstore/build.xml 2010-04-22 15:02:02 UTC (rev 3922)
+++ store/trunk/java/bdbstore/build.xml 2010-04-22 15:02:40 UTC (rev 3923)
@@ -7,6 +7,7 @@
<property name="project.version" value="0.5"/>
<property name="src.tools.dir" location="src/tools/java"/>
<property name="src.main.dir" location="src/main/java"/>
+ <property name="src.resources.dir" location="src/resources"/>
<property name="src.test.dir" location="src/test/java"/>
<property name="build.dir" location="build"/>
<property name="lib.dir" location="lib"/>
@@ -99,7 +100,10 @@
</target>
<target name="jar" depends="build">
- <jar destfile="${bdbstore.jar}" basedir="${build.classes}"/>
+ <jar destfile="${bdbstore.jar}">
+ <fileset dir="${build.classes}"/>
+ <fileset dir="${src.resources.dir}"/>
+ </jar>
<jar destfile="${bdbtools.jar}" basedir="${build.tools.classes}"/>
</target>
14 years, 8 months
rhmessaging commits: r3922 - store/trunk/java/bdbstore/etc.
by rhmessaging-commits@lists.jboss.org
Author: rgemmell
Date: 2010-04-22 11:02:02 -0400 (Thu, 22 Apr 2010)
New Revision: 3922
Modified:
store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb-settings.xml
Log:
Add definition of 'work' to virtualhosts file, as it is now a completely seperate Configuration from the main config and so does not resolve its properties anymore following QPID-2360 updates
merged from java/0.5.x-dev r3885
Modified: store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb-settings.xml
===================================================================
--- store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb-settings.xml 2010-04-22 15:01:15 UTC (rev 3921)
+++ store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb-settings.xml 2010-04-22 15:02:02 UTC (rev 3922)
@@ -20,7 +20,7 @@
-
-->
<virtualhosts>
- <directory>${conf}/virtualhosts</directory>
+ <work>${QPID_WORK}</work>
<virtualhost>
<name>localhost</name>
14 years, 8 months
rhmessaging commits: r3921 - store/trunk/java/bdbstore/etc.
by rhmessaging-commits@lists.jboss.org
Author: rgemmell
Date: 2010-04-22 11:01:15 -0400 (Thu, 22 Apr 2010)
New Revision: 3921
Added:
store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb-settings.xml
store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb.xml
Modified:
store/trunk/java/bdbstore/etc/config-systests-bdb-settings.xml
store/trunk/java/bdbstore/etc/config-systests-bdb.xml
Log:
Update BDBStore systest configuration to align with the changes made for QPID-2360
merged from java/0.5.x-dev r3884
Modified: store/trunk/java/bdbstore/etc/config-systests-bdb-settings.xml
===================================================================
--- store/trunk/java/bdbstore/etc/config-systests-bdb-settings.xml 2010-04-22 15:00:19 UTC (rev 3920)
+++ store/trunk/java/bdbstore/etc/config-systests-bdb-settings.xml 2010-04-22 15:01:15 UTC (rev 3921)
@@ -20,40 +20,7 @@
-
-->
<broker>
- <virtualhosts>
- <directory>${conf}/virtualhosts</directory>
-
- <virtualhost>
- <name>localhost</name>
- <localhost>
- <store>
- <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/localhost-store</environment-path>
- </store>
- </localhost>
- </virtualhost>
-
- <virtualhost>
- <name>development</name>
- <development>
- <store>
- <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/development-store</environment-path>
- </store>
- </development>
- </virtualhost>
-
- <virtualhost>
- <name>test</name>
- <test>
- <store>
- <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/test-store</environment-path>
- </store>
- </test>
- </virtualhost>
-
- </virtualhosts>
+ <virtualhosts>${QPID_HOME}/etc/virtualhosts-systests-bdb.xml</virtualhosts>
</broker>
Modified: store/trunk/java/bdbstore/etc/config-systests-bdb.xml
===================================================================
--- store/trunk/java/bdbstore/etc/config-systests-bdb.xml 2010-04-22 15:00:19 UTC (rev 3920)
+++ store/trunk/java/bdbstore/etc/config-systests-bdb.xml 2010-04-22 15:01:15 UTC (rev 3921)
@@ -22,7 +22,7 @@
<configuration>
<system/>
<override>
- <xml fileName="${test.config}" config-optional="true"/>
+ <xml fileName="${test.config}" optional="true"/>
<xml fileName="${QPID_HOME}/etc/config-systests-bdb-settings.xml"/>
<xml fileName="${QPID_HOME}/etc/config-systests-settings.xml"/>
<xml fileName="${QPID_HOME}/etc/config.xml"/>
Added: store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb-settings.xml
===================================================================
--- store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb-settings.xml (rev 0)
+++ store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb-settings.xml 2010-04-22 15:01:15 UTC (rev 3921)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<virtualhosts>
+ <directory>${conf}/virtualhosts</directory>
+
+ <virtualhost>
+ <name>localhost</name>
+ <localhost>
+ <store>
+ <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
+ <environment-path>${work}/bdbstore/localhost-store</environment-path>
+ </store>
+ </localhost>
+ </virtualhost>
+
+ <virtualhost>
+ <name>development</name>
+ <development>
+ <store>
+ <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
+ <environment-path>${work}/bdbstore/development-store</environment-path>
+ </store>
+ </development>
+ </virtualhost>
+
+ <virtualhost>
+ <name>test</name>
+ <test>
+ <store>
+ <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
+ <environment-path>${work}/bdbstore/test-store</environment-path>
+ </store>
+ </test>
+ </virtualhost>
+</virtualhosts>
+
+
Copied: store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb.xml (from rev 3920, store/trunk/java/bdbstore/etc/config-systests-bdb.xml)
===================================================================
--- store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb.xml (rev 0)
+++ store/trunk/java/bdbstore/etc/virtualhosts-systests-bdb.xml 2010-04-22 15:01:15 UTC (rev 3921)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<configuration>
+ <system/>
+ <override>
+ <xml fileName="${test.virtualhosts}" optional="true"/>
+ <xml fileName="${QPID_HOME}/etc/virtualhosts-systests-bdb-settings.xml"/>
+ <xml fileName="${QPID_HOME}/etc/virtualhosts.xml"/>
+ </override>
+</configuration>
14 years, 8 months
rhmessaging commits: r3920 - store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb.
by rhmessaging-commits@lists.jboss.org
Author: rgemmell
Date: 2010-04-22 11:00:19 -0400 (Thu, 22 Apr 2010)
New Revision: 3920
Modified:
store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
Log:
Update to add deadlock debug options and to disable the LOWERING of the LockTimeout set in r2624. The default is 500000 r2624 set it to 15000. It is believed that this will address the current Deadlock issue that can be seen with simultaneous QueueBind calls. This is committed for testing purposes only on the multicore servers where this failure is currently manifesting.
merged from java/0.5.x-dev r3847
Modified: store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
===================================================================
--- store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2010-04-22 14:59:19 UTC (rev 3919)
+++ store/trunk/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java 2010-04-22 15:00:19 UTC (rev 3920)
@@ -348,7 +348,18 @@
envConfig.setAllowCreate(false);
envConfig.setTransactional(true);
envConfig.setConfigParam("je.lock.nLockTables", "7");
- envConfig.setLockTimeout(15000);
+
+ // Restore 500,000 default timeout.
+ //envConfig.setLockTimeout(15000);
+
+ // Added to help diagnosis of Deadlock issue
+ //
+ // http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#23
+ if (Boolean.getBoolean("qpid.bdb.lock.debug"))
+ {
+ envConfig.setConfigParam("je.txn.deadlockStackTrace", "true");
+ envConfig.setConfigParam("je.txn.dumpLocks", "true");
+ }
// Set transaction mode
_transactionConfig.setReadCommitted(true);
14 years, 8 months
rhmessaging commits: r3919 - store/trunk/java/bdbstore/etc.
by rhmessaging-commits@lists.jboss.org
Author: rgemmell
Date: 2010-04-22 10:59:19 -0400 (Thu, 22 Apr 2010)
New Revision: 3919
Modified:
store/trunk/java/bdbstore/etc/config-systests-bdb-settings.xml
Log:
Update the systest configuration to provide seperate directories for each virtualhost
merged from java/0.5.x-dev r3841
Modified: store/trunk/java/bdbstore/etc/config-systests-bdb-settings.xml
===================================================================
--- store/trunk/java/bdbstore/etc/config-systests-bdb-settings.xml 2010-04-21 18:56:14 UTC (rev 3918)
+++ store/trunk/java/bdbstore/etc/config-systests-bdb-settings.xml 2010-04-22 14:59:19 UTC (rev 3919)
@@ -28,7 +28,7 @@
<localhost>
<store>
<class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdb-store/</environment-path>
+ <environment-path>${work}/bdbstore/localhost-store</environment-path>
</store>
</localhost>
</virtualhost>
@@ -38,7 +38,7 @@
<development>
<store>
<class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdb-store/</environment-path>
+ <environment-path>${work}/bdbstore/development-store</environment-path>
</store>
</development>
</virtualhost>
@@ -48,7 +48,7 @@
<test>
<store>
<class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdb-store/</environment-path>
+ <environment-path>${work}/bdbstore/test-store</environment-path>
</store>
</test>
</virtualhost>
14 years, 8 months
rhmessaging commits: r3918 - mgmt/trunk/sesame/cpp/src/qmfgen.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2010-04-21 14:56:14 -0400 (Wed, 21 Apr 2010)
New Revision: 3918
Modified:
mgmt/trunk/sesame/cpp/src/qmfgen/Makefile.am
Log:
Added force to the .PHONY list in the makefile
Modified: mgmt/trunk/sesame/cpp/src/qmfgen/Makefile.am
===================================================================
--- mgmt/trunk/sesame/cpp/src/qmfgen/Makefile.am 2010-04-21 17:16:37 UTC (rev 3917)
+++ mgmt/trunk/sesame/cpp/src/qmfgen/Makefile.am 2010-04-21 18:56:14 UTC (rev 3918)
@@ -1,4 +1,6 @@
+.PHONY: force
+
force:
EXTRA_DIST = schema.xml
14 years, 8 months
rhmessaging commits: r3917 - mgmt/trunk/sesame/cpp/src.
by rhmessaging-commits@lists.jboss.org
Author: tedross
Date: 2010-04-21 13:16:37 -0400 (Wed, 21 Apr 2010)
New Revision: 3917
Modified:
mgmt/trunk/sesame/cpp/src/SysAgent.cpp
Log:
Removed use of deprecated init call.
Note, the old code was left in as commented-out text. I expect that we will
re-introduce this API in the near future.
Modified: mgmt/trunk/sesame/cpp/src/SysAgent.cpp
===================================================================
--- mgmt/trunk/sesame/cpp/src/SysAgent.cpp 2010-04-21 17:09:13 UTC (rev 3916)
+++ mgmt/trunk/sesame/cpp/src/SysAgent.cpp 2010-04-21 17:16:37 UTC (rev 3917)
@@ -361,6 +361,7 @@
if (interval < 1)
interval = 10;
+ /*
qpid::client::ConnectionSettings settings;
settings.protocol = options["proto"].value;
settings.host = options["host"].value;
@@ -371,9 +372,21 @@
settings.service = options["service"].value;
settings.minSsf = ::atoi(options["min-ssf"].value.c_str());
settings.maxSsf = ::atoi(options["max-ssf"].value.c_str());
+ */
agent->setName("redhat.com", "sesame");
+ agent->init(options["host"].value,
+ ::atoi(options["port"].value.c_str()),
+ interval,
+ false,
+ options["state-dir"].value + "/agentdata",
+ options["uid"].value,
+ options["pwd"].value,
+ options["mech"].value,
+ options["proto"].value);
+ /*
agent->init(settings, interval, false, options["state-dir"].value + "/agentdata");
+ */
::close(0);
::close(1);
14 years, 8 months
rhmessaging commits: r3916 - in store/trunk/cpp: lib/jrnl and 2 other directories.
by rhmessaging-commits@lists.jboss.org
Author: kpvdr
Date: 2010-04-21 13:09:13 -0400 (Wed, 21 Apr 2010)
New Revision: 3916
Modified:
store/trunk/cpp/lib/MessageStoreImpl.cpp
store/trunk/cpp/lib/MessageStoreImpl.h
store/trunk/cpp/lib/jrnl/jerrno.cpp
store/trunk/cpp/lib/jrnl/jerrno.hpp
store/trunk/cpp/tests/SimpleTest.cpp
store/trunk/cpp/tests/python_tests/client_persistence.py
store/trunk/cpp/tests/python_tests/flow_to_disk.py
store/trunk/cpp/tests/python_tests/store_test.py
store/trunk/cpp/tests/run_python_tests
Log:
Removed BDB messages.db. This leaves several methods unimplemented, such as stage() appendContent() and destroy(). However, since the broker has had staging removed, these are never called. These methods now throw an unimplemented exception.
Modified: store/trunk/cpp/lib/MessageStoreImpl.cpp
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/lib/MessageStoreImpl.cpp 2010-04-21 17:09:13 UTC (rev 3916)
@@ -329,7 +329,6 @@
queueDb.reset(new Db(dbenv.get(), 0));
configDb.reset(new Db(dbenv.get(), 0));
exchangeDb.reset(new Db(dbenv.get(), 0));
- messageDb.reset(new Db(dbenv.get(), 0));
mappingDb.reset(new Db(dbenv.get(), 0));
bindingDb.reset(new Db(dbenv.get(), 0));
generalDb.reset(new Db(dbenv.get(), 0));
@@ -338,7 +337,6 @@
open(queueDb, txn.get(), "queues.db", false);
open(configDb, txn.get(), "config.db", false);
open(exchangeDb, txn.get(), "exchanges.db", false);
- open(messageDb, txn.get(), "messages.db", false);
open(mappingDb, txn.get(), "mappings.db", true);
open(bindingDb, txn.get(), "bindings.db", true);
open(generalDb, txn.get(), "general.db", false);
@@ -760,7 +758,7 @@
}
{
qpid::sys::Mutex::ScopedLock sl(jrnlCreateLock);
- jQueue = new JournalImpl(queueName, getJrnlDir(queueName), std::string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout, agent);
+ jQueue = new JournalImpl(queueName, getJrnlHashDir(queueName), std::string("JournalData"), defJournalGetEventsTimeout, defJournalFlushTimeout, agent);
journalList[queueName] = jQueue;
}
queue->setExternalQueueStore(dynamic_cast<ExternalQueueStore*>(jQueue));
@@ -1011,43 +1009,11 @@
}
}
-RecoverableMessage::shared_ptr MessageStoreImpl::getExternMessage(qpid::broker::RecoveryManager& recovery,
- uint64_t messageId,
- unsigned& headerSize)
+RecoverableMessage::shared_ptr MessageStoreImpl::getExternMessage(qpid::broker::RecoveryManager& /*recovery*/,
+ uint64_t /*messageId*/,
+ unsigned& /*headerSize*/)
{
- RecoverableMessage::shared_ptr ret;
- Dbt key (&messageId, sizeof(messageId));
- size_t preamble_length = sizeof(u_int32_t); /*header size*/
-
- BufferValue value(preamble_length, 0);
- value.buffer.record();
-
- TxnCtxt txn;
- txn.begin(dbenv.get(), true);
- try {
- if (messageDb->get(txn.get(), &key, &value, 0) == DB_NOTFOUND) {
- txn.abort();
- THROW_STORE_EXCEPTION("Cannot load content. Message not known to store!");
- }
-
- //read header only to begin with
- headerSize = value.buffer.getLong();
-
- BufferValue header(headerSize, preamble_length);
- if (messageDb->get(txn.get(), &key, &header, 0) == DB_NOTFOUND) {
- txn.abort();
- THROW_STORE_EXCEPTION("Cannot load content. Message not known to store!");
- }
- ret = recovery.recoverMessage(header.buffer);
- txn.commit();
- } catch (const DbException& e) {
- txn.abort();
- THROW_STORE_EXCEPTION("Unexpected BDB error in MessageStoreImpl::getExternMessage(): " + std::string(e.what()));
- } catch (...) {
- txn.abort();
- throw;
- }
- return ret;
+ throw mrg::journal::jexception(mrg::journal::jerrno::JERR__NOTIMPL, "MessageStoreImpl", "getExternMessage");
}
int MessageStoreImpl::enqueueMessage(TxnCtxt& txn,
@@ -1211,46 +1177,14 @@
}
}
-void MessageStoreImpl::stage(const intrusive_ptr<PersistableMessage>& msg)
+void MessageStoreImpl::stage(const intrusive_ptr<PersistableMessage>& /*msg*/)
{
- checkInit();
- TxnCtxt txn;
- txn.begin(dbenv.get(), true);
-
- u_int64_t messageId (msg->getPersistenceId());
- if (messageId == 0 || !msg->isContentReleased()) {
- try {
- Dbt key (&messageId, sizeof(messageId));
- messageId = messageIdSequence.next();
- store(NULL, &txn, key, msg, true);
- msg->setPersistenceId(messageId);
- txn.commit();
- } catch (...) {
- txn.abort();
- throw;
- }
- }
+ throw mrg::journal::jexception(mrg::journal::jerrno::JERR__NOTIMPL, "MessageStoreImpl", "stage");
}
-void MessageStoreImpl::destroy(PersistableMessage& msg)
+void MessageStoreImpl::destroy(PersistableMessage& /*msg*/)
{
- checkInit();
- u_int64_t messageId (msg.getPersistenceId());
- if (messageId) {
- Dbt key (&messageId, sizeof(messageId));
- TxnCtxt txn;
- txn.begin(dbenv.get(), true);
- try {
- deleteIfUnused(txn.get(), key);
- txn.commit();
- } catch (const DbException& e) {
- txn.abort();
- THROW_STORE_EXCEPTION_2("Error destroying message", e);
- } catch (...) {
- txn.abort();
- throw;
- }
- }
+ throw mrg::journal::jexception(mrg::journal::jerrno::JERR__NOTIMPL, "MessageStoreImpl", "destroy");
}
u_int64_t MessageStoreImpl::getRecordSize(db_ptr db,
@@ -1287,41 +1221,10 @@
return peek.get_size();
}
-void MessageStoreImpl::appendContent(const intrusive_ptr<const PersistableMessage>& msg,
- const std::string& data)
+void MessageStoreImpl::appendContent(const intrusive_ptr<const PersistableMessage>& /*msg*/,
+ const std::string& /*data*/)
{
- checkInit();
- u_int64_t messageId (msg->getPersistenceId());
- if (messageId != 0) {
- TxnCtxt txn;
- txn.begin(dbenv.get(), true);
- try {
- Dbt key (&messageId, sizeof(messageId));
- u_int64_t offset = getRecordSize(messageDb, key);
- const int size(data.length());
-
- //don't want to have to copy this and shouldn't need to as
- //it will be used for reading only. but have to cast away
- //the const-ness, which is nasty...
- //alternative involves copying:
- //char buffer[size];
- //data.copy(buffer, size);
- Dbt value((void*) data.data(), size);
- value.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
- value.set_doff(offset);
- value.set_dlen(size);
- messageDb->put(txn.get(), &key, &value, 0);
- txn.commit();
- } catch (const DbException& e) {
- txn.abort();
- THROW_STORE_EXCEPTION_2("Error appending content", e);
- } catch (...) {
- txn.abort();
- throw;
- }
- } else {
- THROW_STORE_EXCEPTION("Cannot append content. Message not known to store!");
- }
+ throw mrg::journal::jexception(mrg::journal::jerrno::JERR__NOTIMPL, "MessageStoreImpl", "appendContent");
}
void MessageStoreImpl::loadContent(const qpid::broker::PersistableQueue& queue,
@@ -1337,53 +1240,19 @@
try {
JournalImpl* jc = static_cast<JournalImpl*>(queue.getExternalQueueStore());
if (jc && jc->is_enqueued(messageId) ) {
- if (jc->loadMsgContent(messageId, data, length, offset)) {
- return;
+ if (!jc->loadMsgContent(messageId, data, length, offset)) {
+ std::ostringstream oss;
+ oss << "Queue " << queue.getName() << ": loadContent() failed: Message " << messageId << " is extern";
+ THROW_STORE_EXCEPTION(oss.str());
}
+ } else {
+ std::ostringstream oss;
+ oss << "Queue " << queue.getName() << ": loadContent() failed: Message " << messageId << " not enqueued";
+ THROW_STORE_EXCEPTION(oss.str());
}
} catch (const journal::jexception& e) {
THROW_STORE_EXCEPTION(std::string("Queue ") + queue.getName() + ": loadContent() failed: " + e.what());
}
- TxnCtxt txn;
- txn.begin(dbenv.get(), true);
- try {
- Dbt key (&messageId, sizeof(messageId));
- char *buffer = new char[length];
- Dbt value(buffer, length);
-
- // Read the first 4 bytes (u_int32_t) which is the header size.
- value.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
- value.set_ulen(sizeof(u_int32_t));
- value.set_doff(0);
- value.set_dlen(sizeof(u_int32_t));
- int status = messageDb->get(txn.get(), &key, &value, 0);
- if (status == DB_NOTFOUND) {
- delete [] buffer;
- THROW_STORE_EXCEPTION("Cannot load content. Message not known to store!");
- }
- u_int32_t hdr_size = Buffer(buffer, sizeof(u_int32_t)).getLong();
-
- // Now read the data.
- u_int64_t realOffset = sizeof(u_int32_t) + hdr_size + offset;
- value.set_flags(DB_DBT_USERMEM | DB_DBT_PARTIAL);
- value.set_ulen(length);
- value.set_doff(realOffset);
- value.set_dlen(length);
- status = messageDb->get(txn.get(), &key, &value, 0);
- if (status == DB_NOTFOUND) {
- delete [] buffer;
- THROW_STORE_EXCEPTION("Cannot load content. Message not known to store!");
- }
- data.assign(buffer, value.get_size());
- delete [] buffer;
- txn.commit();
- } catch (const DbException& e) {
- txn.abort();
- THROW_STORE_EXCEPTION_2("Error loading content", e);
- } catch (...) {
- txn.abort();
- throw;
- }
} else {
THROW_STORE_EXCEPTION("Cannot load content. Message not known to store!");
}
@@ -1415,7 +1284,6 @@
if (queueId == 0) {
THROW_STORE_EXCEPTION("Queue not created: " + queue.getName());
}
- Dbt key (&messageId, sizeof(messageId));
TxnCtxt implicit;
TxnCtxt* txn = 0;
@@ -1431,33 +1299,36 @@
msg->setPersistenceId(messageId);
newId = true;
}
- store(&queue, txn, key, msg, newId);
+ store(&queue, txn, msg, newId);
// add queue* to the txn map..
if (ctxt) txn->addXidRecord(queue.getExternalQueueStore());
}
-void MessageStoreImpl::store(const PersistableQueue* queue,
- TxnCtxt* txn, Dbt& messageId,
- const intrusive_ptr<PersistableMessage>& message,
- bool newId)
+u_int64_t MessageStoreImpl::msgEncode(std::vector<char>& buff, const intrusive_ptr<PersistableMessage>& message)
{
u_int32_t headerSize = message->encodedHeaderSize();
u_int64_t size = message->encodedSize() + sizeof(u_int32_t);
- std::vector<char> buff;
- if (!message->isContentReleased() )
- {
- try { buff = std::vector<char>(size); } // long + headers + content
- catch (const std::exception& e) {
- std::ostringstream oss;
- oss << "Unable to allocate memory for encoding message; requested size: " << size << "; error: " << e.what();
- THROW_STORE_EXCEPTION(oss.str());
- }
- Buffer buffer(&buff[0],size);
- buffer.putLong(headerSize);
- message->encode(buffer);
+ try { buff = std::vector<char>(size); } // long + headers + content
+ catch (const std::exception& e) {
+ std::ostringstream oss;
+ oss << "Unable to allocate memory for encoding message; requested size: " << size << "; error: " << e.what();
+ THROW_STORE_EXCEPTION(oss.str());
}
+ Buffer buffer(&buff[0],size);
+ buffer.putLong(headerSize);
+ message->encode(buffer);
+ return size;
+}
+void MessageStoreImpl::store(const PersistableQueue* queue,
+ TxnCtxt* txn,
+ const intrusive_ptr<PersistableMessage>& message,
+ bool /*newId*/)
+{
+ std::vector<char> buff;
+ u_int64_t size = msgEncode(buff, message);
+
try {
if (queue) {
boost::intrusive_ptr<DataTokenImpl> dtokp(new DataTokenImpl);
@@ -1481,12 +1352,8 @@
}
}
} else {
- /// cct message db
- if (newId) { // only store in Bd if first time message is stored
- Dbt data(&buff[0],size);
- messageDb->put(txn->get(), &messageId, &data, DB_NOOVERWRITE);
- }
- }
+ THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() + ": store() failed: queue NULL.");
+ }
} catch (const journal::jexception& e) {
THROW_STORE_EXCEPTION(std::string("Queue ") + queue->getName() + ": store() failed: " +
e.what());
@@ -1558,39 +1425,6 @@
return 0;
}
-bool MessageStoreImpl::deleteIfUnused(DbTxn* txn,
- Dbt& messageId)
-{
- Cursor cursor;
- cursor.open(mappingDb, txn);
- return deleteIfUnused(cursor, txn, messageId);
-}
-
-bool MessageStoreImpl::deleteIfUnused(Cursor& cursor,
- DbTxn* txn,
- Dbt& messageId)
-{
- if (isUnused(cursor, messageId)) {
- messageDb->del(txn, &messageId, 0);
- return true;
- } else {
- return false;
- }
-}
-
-bool MessageStoreImpl::isUnused(Cursor& cursor, Dbt& messageId)
-{
- Dbt empty;
- int status = cursor->get(&messageId, &empty, DB_SET);
- if (status == DB_NOTFOUND) {
- return true;
- } else if (status == 0) {
- return false;
- } else {
- THROW_STORE_EXCEPTION("Dequeue failed (in isUnused()) with status = " + status);
- }
-}
-
void MessageStoreImpl::completed(TxnCtxt& txn,
bool commit)
{
@@ -1833,7 +1667,7 @@
std::string MessageStoreImpl::getJrnlDir(const qpid::broker::PersistableQueue& queue) //for exmaple /var/rhm/ + queueDir/
{
- return getJrnlDir(queue.getName().c_str());
+ return getJrnlHashDir(queue.getName().c_str());
}
u_int32_t MessageStoreImpl::bHash(const std::string str)
@@ -1845,7 +1679,7 @@
return h;
}
-std::string MessageStoreImpl::getJrnlDir(const std::string& queueName) //for exmaple /var/rhm/ + queueDir/
+std::string MessageStoreImpl::getJrnlHashDir(const std::string& queueName) //for exmaple /var/rhm/ + queueDir/
{
std::stringstream dir;
dir << getJrnlBaseDir() << std::hex << std::setfill('0') << std::setw(4);
Modified: store/trunk/cpp/lib/MessageStoreImpl.h
===================================================================
--- store/trunk/cpp/lib/MessageStoreImpl.h 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/lib/MessageStoreImpl.h 2010-04-21 17:09:13 UTC (rev 3916)
@@ -118,7 +118,6 @@
db_ptr queueDb;
db_ptr configDb;
db_ptr exchangeDb;
- db_ptr messageDb;
db_ptr mappingDb;
db_ptr bindingDb;
db_ptr generalDb;
@@ -207,21 +206,14 @@
void recoverTplStore();
void recoverLockedMappings(txn_list& txns);
TxnCtxt* check(qpid::broker::TransactionContext* ctxt);
+ u_int64_t msgEncode(std::vector<char>& buff, const boost::intrusive_ptr<qpid::broker::PersistableMessage>& message);
void store(const qpid::broker::PersistableQueue* queue,
TxnCtxt* txn,
- Dbt& messageId,
const boost::intrusive_ptr<qpid::broker::PersistableMessage>& message,
bool newId);
void async_dequeue(qpid::broker::TransactionContext* ctxt,
const boost::intrusive_ptr<qpid::broker::PersistableMessage>& msg,
const qpid::broker::PersistableQueue& queue);
- bool deleteIfUnused(Cursor& cursor,
- DbTxn* txn,
- Dbt& messageId);
- bool deleteIfUnused(DbTxn* txn,
- Dbt& messageId);
- bool isUnused(Cursor& cursor,
- Dbt& messageId);
void destroy(db_ptr db,
const qpid::broker::Persistable& p);
bool create(db_ptr db,
@@ -260,7 +252,7 @@
void createJrnlQueue(const qpid::broker::PersistableQueue& queue);
u_int32_t bHash(const std::string str);
std::string getJrnlDir(const qpid::broker::PersistableQueue& queue); //for exmaple /var/rhm/ + queueDir/
- std::string getJrnlDir(const std::string& queueName);
+ std::string getJrnlHashDir(const std::string& queueName);
std::string getJrnlBaseDir();
std::string getBdbBaseDir();
std::string getTplBaseDir();
Modified: store/trunk/cpp/lib/jrnl/jerrno.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.cpp 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/lib/jrnl/jerrno.cpp 2010-04-21 17:09:13 UTC (rev 3916)
@@ -54,6 +54,7 @@
const u_int32_t jerrno::JERR__TIMEOUT = 0x0107;
const u_int32_t jerrno::JERR__UNEXPRESPONSE = 0x0108;
const u_int32_t jerrno::JERR__RECNFOUND = 0x0109;
+const u_int32_t jerrno::JERR__NOTIMPL = 0x010a;
// class jcntl
const u_int32_t jerrno::JERR_JCNTL_STOPPED = 0x0200;
@@ -144,6 +145,7 @@
_err_map[JERR__TIMEOUT] = "JERR__TIMEOUT: Timeout waiting for event.";
_err_map[JERR__UNEXPRESPONSE] = "JERR__UNEXPRESPONSE: Unexpected response to call or event.";
_err_map[JERR__RECNFOUND] = "JERR__RECNFOUND: Record not found.";
+ _err_map[JERR__NOTIMPL] = "JERR__NOTIMPL: Not implemented";
// class jcntl
_err_map[JERR_JCNTL_STOPPED] = "JERR_JCNTL_STOPPED: Operation on stopped journal.";
@@ -152,7 +154,7 @@
_err_map[JERR_JCNTL_UNKNOWNMAGIC] = "JERR_JCNTL_UNKNOWNMAGIC: Found record with unknown magic.";
_err_map[JERR_JCNTL_NOTRECOVERED] = "JERR_JCNTL_NOTRECOVERED: Operation requires recover() to be run first.";
_err_map[JERR_JCNTL_RECOVERJFULL] = "JERR_JCNTL_RECOVERJFULL: Journal data files full, cannot write.";
- _err_map[JERR_JCNTL_OWIMISMATCH] = "JERR_JCNTL_OWIMISMATCH: Overwrite Indecator (OWI) change found in unexpected location.";
+ _err_map[JERR_JCNTL_OWIMISMATCH] = "JERR_JCNTL_OWIMISMATCH: Overwrite Indicator (OWI) change found in unexpected location.";
// class jdir
_err_map[JERR_JDIR_NOTDIR] = "JERR_JDIR_NOTDIR: Directory name exists but is not a directory.";
Modified: store/trunk/cpp/lib/jrnl/jerrno.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jerrno.hpp 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/lib/jrnl/jerrno.hpp 2010-04-21 17:09:13 UTC (rev 3916)
@@ -72,6 +72,7 @@
static const u_int32_t JERR__TIMEOUT; ///< Timeout waiting for an event
static const u_int32_t JERR__UNEXPRESPONSE; ///< Unexpected response to call or event
static const u_int32_t JERR__RECNFOUND; ///< Record not found
+ static const u_int32_t JERR__NOTIMPL; ///< Not implemented
// class jcntl
static const u_int32_t JERR_JCNTL_STOPPED; ///< Operation on stopped journal
Modified: store/trunk/cpp/tests/SimpleTest.cpp
===================================================================
--- store/trunk/cpp/tests/SimpleTest.cpp 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/tests/SimpleTest.cpp 2010-04-21 17:09:13 UTC (rev 3916)
@@ -360,35 +360,6 @@
cout << "ok" << endl;
}
-QPID_AUTO_TEST_CASE(DestroyEnqueuedMessage)
-{
- cout << test_filename << ".DestroyEnqueuedMessage: " << flush;
-
- MessageStoreImpl store;
- 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()));
- intrusive_ptr<PersistableMessage> pmsg = static_pointer_cast<PersistableMessage>(msg);
- intrusive_ptr<const PersistableMessage> cpmsg = static_pointer_cast<const PersistableMessage>(msg);
- MessageUtils::addContent(msg, data);
-
- Queue queue("my_queue", 0, &store, 0);
- store.create(queue, qpid::framing::FieldTable());
-
- store.enqueue(0, pmsg, queue);
- store.destroy(*pmsg);
-
- string loaded;
- store.loadContent(queue, cpmsg, loaded, 0, data.length());
- BOOST_CHECK_EQUAL(data, loaded);
-
- store.dequeue(0, pmsg, queue);
- store.destroy(queue);
-
- cout << "ok" << endl;
-}
-
QPID_AUTO_TEST_CASE(ExchangeCreateAndDestroy)
{
cout << test_filename << ".ExchangeCreateAndDestroy: " << flush;
Modified: store/trunk/cpp/tests/python_tests/client_persistence.py
===================================================================
--- store/trunk/cpp/tests/python_tests/client_persistence.py 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/tests/python_tests/client_persistence.py 2010-04-21 17:09:13 UTC (rev 3916)
@@ -129,6 +129,7 @@
qmf = Qmf(broker)
qmf.add_exchange("altExch", "direct", durable=True) # Serves as alternate exchange instance
qmf.add_exchange("testExch", "direct", durable=True, alt_exchange_name="altExch")
+ qmf.close()
broker.terminate()
broker = self.broker(store_args(), name="testExchangeBroker")
@@ -143,6 +144,7 @@
self.fail("Test exchange (\"testExch\") instance not recovered: %s" % error)
self.assertTrue(qmf.query_exchange("testExch", alt_exchange_name = "altExch"),
"Alternate exchange property not found or is incorrect on exchange \"testExch\".")
+ qmf.close()
def test_queue(self):
"""Queue alternate exchange property persistexchangeNamece test"""
@@ -150,6 +152,7 @@
qmf = Qmf(broker)
qmf.add_exchange("altExch", "direct", durable=True) # Serves as alternate exchange instance
qmf.add_queue("testQueue", durable=True, alt_exchange_name="altExch")
+ qmf.close()
broker.terminate()
broker = self.broker(store_args(), name="testQueueBroker")
@@ -164,6 +167,7 @@
self.fail("Test queue (\"testQueue\") instance not recovered: %s" % error)
self.assertTrue(qmf.query_queue("testQueue", alt_exchange_name = "altExch"),
"Alternate exchange property not found or is incorrect on queue \"testQueue\".")
+ qmf.close()
class RedeliveredTests(StoreTest):
Modified: store/trunk/cpp/tests/python_tests/flow_to_disk.py
===================================================================
--- store/trunk/cpp/tests/python_tests/flow_to_disk.py 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/tests/python_tests/flow_to_disk.py 2010-04-21 17:09:13 UTC (rev 3916)
@@ -294,11 +294,12 @@
def test_durable(self):
"""Durable message test"""
- self.simple_limit("MaxSizeMaxCountDurable", max_count=10, max_size=1000, msg_size=250)
+ self.simple_limit("MaxSizeMaxCountDurable", max_count=10, max_size=1000, msg_size=250, msg_durable=True)
def test_durable_recover(self):
"""Durable message recover test"""
- self.simple_limit("MaxSizeMaxCountDurableRecover", max_count=10, max_size=1000, msg_size=250, recover=True)
+ self.simple_limit("MaxSizeMaxCountDurableRecover", max_count=10, max_size=1000, msg_size=250, msg_durable=True,
+ recover=True)
def test_browse(self):
"""Browse test"""
@@ -310,12 +311,13 @@
def test_durable_browse(self):
"""Browse durable message test"""
- self.simple_limit("MaxSizeMaxCountDurableBrowse", max_count=10, max_size=1000, msg_size=250, browse=True)
+ self.simple_limit("MaxSizeMaxCountDurableBrowse", max_count=10, max_size=1000, msg_size=250, msg_durable=True,
+ browse=True)
def test_durable_browse_recover(self):
"""Browse durable messages before and after recover"""
- self.simple_limit("MaxSizeMaxCountDurableBrowseRecover", max_count=10, max_size=1000, msg_size=250, browse=True,
- recover=True)
+ self.simple_limit("MaxSizeMaxCountDurableBrowseRecover", max_count=10, max_size=1000, msg_size=250,
+ msg_durable=True, browse=True, recover=True)
# ======================================================================================================================
Modified: store/trunk/cpp/tests/python_tests/store_test.py
===================================================================
--- store/trunk/cpp/tests/python_tests/store_test.py 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/tests/python_tests/store_test.py 2010-04-21 17:09:13 UTC (rev 3916)
@@ -107,6 +107,10 @@
def queue_empty(self, queue_name):
"""Check if a queue is empty (has no messages waiting)"""
return self.queue_message_count(queue_name) == 0
+
+ def close(self):
+ self.__session.delBroker(self.__broker)
+ self.__session = None
class StoreTest(BrokerTest):
Modified: store/trunk/cpp/tests/run_python_tests
===================================================================
--- store/trunk/cpp/tests/run_python_tests 2010-04-21 15:40:23 UTC (rev 3915)
+++ store/trunk/cpp/tests/run_python_tests 2010-04-21 17:09:13 UTC (rev 3916)
@@ -42,7 +42,7 @@
case x$1 in
xSHORT_TEST)
- DEFAULT_PYTHON_TESTS="*.client_persistence.ExchangeQueueTests.* *.flow_to_disk.SimpleMaxSizeCountTest.test_durable_browse_recover *.flow_to_disk.MultiDurableQueueDurableMsgBrowseRecoverTxPTxCTest.test_mixed_limit_2" ;;
+ DEFAULT_PYTHON_TESTS="*.client_persistence.ExchangeQueueTests.* *.flow_to_disk.SimpleMaxSizeCountTest.test_browse_recover *.flow_to_disk.SimpleMaxSizeCountTest.test_durable_browse_recover *.flow_to_disk.MultiDurableQueueDurableMsgBrowseRecoverTxPTxCTest.test_mixed_limit_2" ;;
xLONG_TEST)
DEFAULT_PYTHON_TESTS= ;;
x)
14 years, 8 months
rhmessaging commits: r3915 - store/trunk.
by rhmessaging-commits@lists.jboss.org
Author: gordonsim
Date: 2010-04-21 11:40:23 -0400 (Wed, 21 Apr 2010)
New Revision: 3915
Removed:
store/trunk/test
Log:
cleanup previous test of write access
Deleted: store/trunk/test
===================================================================
--- store/trunk/test 2010-04-21 15:39:52 UTC (rev 3914)
+++ store/trunk/test 2010-04-21 15:40:23 UTC (rev 3915)
@@ -1 +0,0 @@
-this is a test
14 years, 8 months