diff options
author | Alan Conway <aconway@apache.org> | 2008-11-24 18:06:43 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-11-24 18:06:43 +0000 |
commit | f7057e4c908f797d89500e2554490cec9b373788 (patch) | |
tree | 3af19eefe0e4c37b6531446a0eab482a722e19a6 | |
parent | eec5bffa802b66904bba3b8c7af868ef318c0fdb (diff) | |
download | qpid-python-f7057e4c908f797d89500e2554490cec9b373788.tar.gz |
Reduce logging noise from NullMessageStore: log "persistence disabled" once at start up, not on every action.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@720243 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/qpid/broker/Broker.cpp | 2 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/broker/NullMessageStore.cpp | 48 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/broker/NullMessageStore.h | 3 | ||||
-rw-r--r-- | qpid/cpp/src/tests/QueueTest.cpp | 2 | ||||
-rw-r--r-- | qpid/cpp/src/tests/TestMessageStore.h | 2 |
5 files changed, 16 insertions, 41 deletions
diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp index 2c47c78f58..0ae6106f57 100644 --- a/qpid/cpp/src/qpid/broker/Broker.cpp +++ b/qpid/cpp/src/qpid/broker/Broker.cpp @@ -195,7 +195,7 @@ Broker::Broker(const Broker::Options& conf) : // If no plugin store module registered itself, set up the null store. if (store.get() == 0) - setStore (new NullMessageStore (false)); + setStore (new NullMessageStore()); exchanges.declare(empty, DirectExchange::typeName); // Default exchange. diff --git a/qpid/cpp/src/qpid/broker/NullMessageStore.cpp b/qpid/cpp/src/qpid/broker/NullMessageStore.cpp index edb4cc7d97..689ed15707 100644 --- a/qpid/cpp/src/qpid/broker/NullMessageStore.cpp +++ b/qpid/cpp/src/qpid/broker/NullMessageStore.cpp @@ -44,14 +44,14 @@ public: } }; -NullMessageStore::NullMessageStore(bool _warn) : warn(_warn), nextPersistenceId(1) {} +NullMessageStore::NullMessageStore() : nextPersistenceId(1) { + QPID_LOG(info, "No message store configured, persistence is disabled.") +} bool NullMessageStore::init(const Options* /*options*/) {return true;} void NullMessageStore::create(PersistableQueue& queue, const framing::FieldTable& /*args*/) { - QPID_LOG(info, "Queue '" << queue.getName() - << "' will not be durable. Persistence not enabled."); queue.setPersistenceId(nextPersistenceId++); } @@ -61,8 +61,6 @@ void NullMessageStore::destroy(PersistableQueue&) void NullMessageStore::create(const PersistableExchange& exchange, const framing::FieldTable& /*args*/) { - QPID_LOG(info, "Exchange'" << exchange.getName() - << "' will not be durable. Persistence not enabled."); exchange.setPersistenceId(nextPersistenceId++); } @@ -75,47 +73,28 @@ void NullMessageStore::unbind(const PersistableExchange&, const PersistableQueue void NullMessageStore::create(const PersistableConfig& config) { - QPID_LOG(info, "Persistence not enabled, configuration not stored."); config.setPersistenceId(nextPersistenceId++); } -void NullMessageStore::destroy(const PersistableConfig&) -{ - QPID_LOG(info, "Persistence not enabled, configuration not stored."); -} +void NullMessageStore::destroy(const PersistableConfig&) {} -void NullMessageStore::recover(RecoveryManager&) -{ - QPID_LOG(info, "Persistence not enabled, no recovery attempted."); -} +void NullMessageStore::recover(RecoveryManager&) {} -void NullMessageStore::stage(const intrusive_ptr<PersistableMessage>&) -{ - QPID_LOG(info, "Can't stage message. Persistence not enabled."); -} +void NullMessageStore::stage(const intrusive_ptr<PersistableMessage>&) {} -void NullMessageStore::destroy(PersistableMessage&) -{ -} +void NullMessageStore::destroy(PersistableMessage&) {} -void NullMessageStore::appendContent(const intrusive_ptr<const PersistableMessage>&, const string&) -{ - QPID_LOG(info, "Can't append content. Persistence not enabled."); -} +void NullMessageStore::appendContent(const intrusive_ptr<const PersistableMessage>&, const string&) {} void NullMessageStore::loadContent(const qpid::broker::PersistableQueue&, const intrusive_ptr<const PersistableMessage>&, - string&, uint64_t, uint32_t) -{ - QPID_LOG(info, "Can't load content. Persistence not enabled."); -} + string&, uint64_t, uint32_t) {} void NullMessageStore::enqueue(TransactionContext*, const intrusive_ptr<PersistableMessage>& msg, - const PersistableQueue& queue) + const PersistableQueue&) { msg->enqueueComplete(); - QPID_LOG(info, "Message is not durably recorded on '" << queue.getName() << "'. Persistence not enabled."); } void NullMessageStore::dequeue(TransactionContext*, @@ -125,12 +104,9 @@ void NullMessageStore::dequeue(TransactionContext*, msg->dequeueComplete(); } -void NullMessageStore::flush(const qpid::broker::PersistableQueue&) -{ -} +void NullMessageStore::flush(const qpid::broker::PersistableQueue&) {} -uint32_t NullMessageStore::outstandingQueueAIO(const PersistableQueue& ) -{ +uint32_t NullMessageStore::outstandingQueueAIO(const PersistableQueue& ) { return 0; } diff --git a/qpid/cpp/src/qpid/broker/NullMessageStore.h b/qpid/cpp/src/qpid/broker/NullMessageStore.h index 4b8d02d555..f384253de6 100644 --- a/qpid/cpp/src/qpid/broker/NullMessageStore.h +++ b/qpid/cpp/src/qpid/broker/NullMessageStore.h @@ -36,10 +36,9 @@ namespace broker { class NullMessageStore : public MessageStore { std::set<std::string> prepared; - const bool warn; uint64_t nextPersistenceId; public: - NullMessageStore(bool warn = false); + NullMessageStore(); virtual bool init(const Options* options); virtual std::auto_ptr<TransactionContext> begin(); diff --git a/qpid/cpp/src/tests/QueueTest.cpp b/qpid/cpp/src/tests/QueueTest.cpp index 80ea05c073..c60ee6dcb5 100644 --- a/qpid/cpp/src/tests/QueueTest.cpp +++ b/qpid/cpp/src/tests/QueueTest.cpp @@ -284,7 +284,7 @@ class TestMessageStoreOC : public NullMessageStore { } - TestMessageStoreOC() : NullMessageStore(false) {} + TestMessageStoreOC() : NullMessageStore() {} ~TestMessageStoreOC(){} }; diff --git a/qpid/cpp/src/tests/TestMessageStore.h b/qpid/cpp/src/tests/TestMessageStore.h index a6fe716e9c..be1ed57349 100644 --- a/qpid/cpp/src/tests/TestMessageStore.h +++ b/qpid/cpp/src/tests/TestMessageStore.h @@ -51,7 +51,7 @@ class TestMessageStore : public NullMessageStore enqueued.push_back(msg_queue_pair(queue.getName(), msg)); } - TestMessageStore() : NullMessageStore(false) {} + TestMessageStore() : NullMessageStore() {} ~TestMessageStore(){} }; |