summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/store
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/store')
-rw-r--r--cpp/src/qpid/store/CMakeLists.txt7
-rw-r--r--cpp/src/qpid/store/MessageStorePlugin.cpp6
-rw-r--r--cpp/src/qpid/store/MessageStorePlugin.h26
-rw-r--r--cpp/src/qpid/store/StorageProvider.h14
-rw-r--r--cpp/src/qpid/store/ms-clfs/MSSqlClfsProvider.cpp20
-rw-r--r--cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp19
-rw-r--r--cpp/src/qpid/store/ms-sql/MessageRecordset.cpp2
7 files changed, 17 insertions, 77 deletions
diff --git a/cpp/src/qpid/store/CMakeLists.txt b/cpp/src/qpid/store/CMakeLists.txt
index 9abdf0ae3d..31623f8e84 100644
--- a/cpp/src/qpid/store/CMakeLists.txt
+++ b/cpp/src/qpid/store/CMakeLists.txt
@@ -42,6 +42,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set_target_properties (store PROPERTIES
PREFIX ""
+ COMPILE_DEFINITIONS _IN_QPID_BROKER
LINK_FLAGS "${GCC_CATCH_UNDEFINED}")
endif (CMAKE_COMPILER_IS_GNUCXX)
@@ -54,7 +55,9 @@ if (CMAKE_SYSTEM_NAME STREQUAL Windows)
endif (MSVC)
endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
-set_target_properties (store PROPERTIES VERSION ${qpidc_version})
+set_target_properties (store PROPERTIES
+ COMPILE_DEFINITIONS _IN_QPID_BROKER
+ VERSION ${qpidc_version})
install (TARGETS store # RUNTIME
DESTINATION ${QPIDD_MODULE_DIR}
COMPONENT ${QPID_COMPONENT_BROKER})
@@ -81,6 +84,7 @@ if (BUILD_MSSQL)
ms-sql/State.cpp
ms-sql/TplRecordset.cpp
ms-sql/VariantHelper.cpp)
+ set_target_properties (mssql_store PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
target_link_libraries (mssql_store qpidbroker qpidcommon ${Boost_PROGRAM_OPTIONS_LIBRARY})
install (TARGETS mssql_store # RUNTIME
DESTINATION ${QPIDD_MODULE_DIR}
@@ -110,6 +114,7 @@ if (BUILD_MSCLFS)
ms-sql/State.cpp
ms-sql/VariantHelper.cpp)
include_directories(ms-sql)
+ set_target_properties (msclfs_store PROPERTIES COMPILE_DEFINITIONS _IN_QPID_BROKER)
target_link_libraries (msclfs_store qpidbroker qpidcommon ${Boost_PROGRAM_OPTIONS_LIBRARY} clfsw32.lib)
install (TARGETS msclfs_store # RUNTIME
DESTINATION ${QPIDD_MODULE_DIR}
diff --git a/cpp/src/qpid/store/MessageStorePlugin.cpp b/cpp/src/qpid/store/MessageStorePlugin.cpp
index d72200c2ba..b869ecadbc 100644
--- a/cpp/src/qpid/store/MessageStorePlugin.cpp
+++ b/cpp/src/qpid/store/MessageStorePlugin.cpp
@@ -137,12 +137,6 @@ MessageStorePlugin::providerAvailable(const std::string name,
QPID_LOG(warning, "Storage provider " << name << " duplicate; ignored.");
}
-void
-MessageStorePlugin::truncateInit(const bool /*saveStoreContent*/)
-{
- QPID_LOG(info, "Store: truncateInit");
-}
-
/**
* Record the existence of a durable queue
diff --git a/cpp/src/qpid/store/MessageStorePlugin.h b/cpp/src/qpid/store/MessageStorePlugin.h
index 4a9bb2aecb..1fcde6683d 100644
--- a/cpp/src/qpid/store/MessageStorePlugin.h
+++ b/cpp/src/qpid/store/MessageStorePlugin.h
@@ -24,18 +24,22 @@
#include "qpid/Plugin.h"
#include "qpid/Options.h"
-#include "qpid/broker/Broker.h"
#include "qpid/broker/MessageStore.h"
-#include "qpid/broker/PersistableExchange.h"
-#include "qpid/broker/PersistableMessage.h"
-#include "qpid/broker/PersistableQueue.h"
-#include "qpid/management/Manageable.h"
+//#include "qpid/management/Manageable.h"
#include <string>
using namespace qpid;
namespace qpid {
+
+namespace broker {
+class Broker;
+class PersistableExchange;
+class PersistableMessage;
+class PersistableQueue;
+}
+
namespace store {
class StorageProvider;
@@ -82,18 +86,6 @@ class MessageStorePlugin :
/**
* @name Methods inherited from qpid::broker::MessageStore
*/
- //@{
- /**
- * If called before recovery, will discard the database and reinitialize
- * using an empty store. This is used when cluster nodes recover and
- * must get their content from a cluster sync rather than directly from
- * the store.
- *
- * @param saveStoreContent If true, the store's contents should be
- * saved to a backup location before
- * reinitializing the store content.
- */
- virtual void truncateInit(const bool saveStoreContent = false);
/**
* Record the existence of a durable queue
diff --git a/cpp/src/qpid/store/StorageProvider.h b/cpp/src/qpid/store/StorageProvider.h
index d162cc58ec..de12ffb869 100644
--- a/cpp/src/qpid/store/StorageProvider.h
+++ b/cpp/src/qpid/store/StorageProvider.h
@@ -143,20 +143,6 @@ public:
/**
* @name Methods inherited from qpid::broker::MessageStore
*/
- //@{
- /**
- * If called after init() but before recovery, will discard the database
- * and reinitialize using an empty store dir. If @a pushDownStoreFiles
- * is true, the content of the store dir will be moved to a backup dir
- * inside the store dir. This is used when cluster nodes recover and must
- * get thier content from a cluster sync rather than directly fromt the
- * store.
- *
- * @param pushDownStoreFiles If true, will move content of the store dir
- * into a subdir, leaving the store dir
- * otherwise empty.
- */
- virtual void truncateInit(const bool pushDownStoreFiles = false) = 0;
/**
* Record the existence of a durable queue
diff --git a/cpp/src/qpid/store/ms-clfs/MSSqlClfsProvider.cpp b/cpp/src/qpid/store/ms-clfs/MSSqlClfsProvider.cpp
index 586aaaf980..90785263d3 100644
--- a/cpp/src/qpid/store/ms-clfs/MSSqlClfsProvider.cpp
+++ b/cpp/src/qpid/store/ms-clfs/MSSqlClfsProvider.cpp
@@ -26,6 +26,7 @@
#include <string>
#include <windows.h>
#include <clfsw32.h>
+#include <qpid/broker/Broker.h>
#include <qpid/broker/RecoverableQueue.h>
#include <qpid/log/Statement.h>
#include <qpid/store/MessageStorePlugin.h>
@@ -108,20 +109,6 @@ public:
/**
* @name Methods inherited from qpid::broker::MessageStore
*/
- //@{
- /**
- * If called after init() but before recovery, will discard the database
- * and reinitialize using an empty store dir. If @a pushDownStoreFiles
- * is true, the content of the store dir will be moved to a backup dir
- * inside the store dir. This is used when cluster nodes recover and must
- * get their content from a cluster sync rather than directly from the
- * store.
- *
- * @param pushDownStoreFiles If true, will move content of the store dir
- * into a subdir, leaving the store dir
- * otherwise empty.
- */
- virtual void truncateInit(const bool pushDownStoreFiles = false);
/**
* Record the existence of a durable queue
@@ -467,11 +454,6 @@ MSSqlClfsProvider::activate(MessageStorePlugin &store)
}
void
-MSSqlClfsProvider::truncateInit(const bool pushDownStoreFiles)
-{
-}
-
-void
MSSqlClfsProvider::create(PersistableQueue& queue,
const qpid::framing::FieldTable& /*args needed for jrnl*/)
{
diff --git a/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp b/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp
index 7f22db3d02..1432cc8fca 100644
--- a/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp
+++ b/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp
@@ -92,20 +92,6 @@ public:
/**
* @name Methods inherited from qpid::broker::MessageStore
*/
- //@{
- /**
- * If called after init() but before recovery, will discard the database
- * and reinitialize using an empty store dir. If @a pushDownStoreFiles
- * is true, the content of the store dir will be moved to a backup dir
- * inside the store dir. This is used when cluster nodes recover and must
- * get thier content from a cluster sync rather than directly fromt the
- * store.
- *
- * @param pushDownStoreFiles If true, will move content of the store dir
- * into a subdir, leaving the store dir
- * otherwise empty.
- */
- virtual void truncateInit(const bool pushDownStoreFiles = false);
/**
* Record the existence of a durable queue
@@ -392,11 +378,6 @@ MSSqlProvider::activate(MessageStorePlugin &store)
}
void
-MSSqlProvider::truncateInit(const bool pushDownStoreFiles)
-{
-}
-
-void
MSSqlProvider::create(PersistableQueue& queue,
const qpid::framing::FieldTable& /*args needed for jrnl*/)
{
diff --git a/cpp/src/qpid/store/ms-sql/MessageRecordset.cpp b/cpp/src/qpid/store/ms-sql/MessageRecordset.cpp
index b62a333df6..495f1a08c2 100644
--- a/cpp/src/qpid/store/ms-sql/MessageRecordset.cpp
+++ b/cpp/src/qpid/store/ms-sql/MessageRecordset.cpp
@@ -147,7 +147,7 @@ MessageRecordset::recover(qpid::broker::RecoveryManager& recoverer,
// Now, do we need the rest of the content?
long contentLength = blobSize - headerFieldLength - headerSize;
- if (msg->loadContent(contentLength)) {
+ if (contentLength > 0 && msg->loadContent(contentLength)) {
BlobAdapter content(contentLength);
content =
rs->Fields->Item["fieldTableBlob"]->GetChunk(contentLength);