You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2008/11/24 19:06:43 UTC

svn commit: r720243 - in /incubator/qpid/trunk/qpid/cpp/src: qpid/broker/Broker.cpp qpid/broker/NullMessageStore.cpp qpid/broker/NullMessageStore.h tests/QueueTest.cpp tests/TestMessageStore.h

Author: aconway
Date: Mon Nov 24 10:06:43 2008
New Revision: 720243

URL: http://svn.apache.org/viewvc?rev=720243&view=rev
Log:
Reduce logging noise from NullMessageStore: log "persistence disabled" once at start up, not on every action.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.h
    incubator/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp
    incubator/qpid/trunk/qpid/cpp/src/tests/TestMessageStore.h

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp?rev=720243&r1=720242&r2=720243&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Broker.cpp Mon Nov 24 10:06:43 2008
@@ -195,7 +195,7 @@
 
     // 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.
     

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp?rev=720243&r1=720242&r2=720243&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.cpp Mon Nov 24 10:06:43 2008
@@ -44,14 +44,14 @@
     }
 };
 
-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::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::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 @@
     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;
 }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.h?rev=720243&r1=720242&r2=720243&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/NullMessageStore.h Mon Nov 24 10:06:43 2008
@@ -36,10 +36,9 @@
 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();

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp?rev=720243&r1=720242&r2=720243&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp Mon Nov 24 10:06:43 2008
@@ -284,7 +284,7 @@
     {
     }
 
-    TestMessageStoreOC() : NullMessageStore(false) {}
+    TestMessageStoreOC() : NullMessageStore() {}
     ~TestMessageStoreOC(){}
 };
 

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/TestMessageStore.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/TestMessageStore.h?rev=720243&r1=720242&r2=720243&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/TestMessageStore.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/TestMessageStore.h Mon Nov 24 10:06:43 2008
@@ -51,7 +51,7 @@
         enqueued.push_back(msg_queue_pair(queue.getName(), msg));
     }
 
-    TestMessageStore() : NullMessageStore(false) {}
+    TestMessageStore() : NullMessageStore() {}
     ~TestMessageStore(){}
 };