diff options
| author | Alan Conway <aconway@apache.org> | 2009-11-24 20:07:24 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2009-11-24 20:07:24 +0000 |
| commit | 0fb7ff9cfbfd01e9093c2c6021a5915696d2a089 (patch) | |
| tree | 1d2db335592be80a9aa9f8f404d2c1682afeb485 /cpp/src/qpid/broker/Broker.cpp | |
| parent | 1ee447563d208b39e962537a47f14aea741777b0 (diff) | |
| download | qpid-python-0fb7ff9cfbfd01e9093c2c6021a5915696d2a089.tar.gz | |
Support for restarting a persistent cluster.
Option --cluster-size=N: members wait for N members before recovering store.
Stores marked as clean/dirty. Automatically recover from clean store on restart.
Stores marked with UUID to detect errors.
Not yet implemented: consistency checks, manual recovery from all dirty stores.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@883842 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Broker.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/Broker.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp index 58569f5503..3c67c429a0 100644 --- a/cpp/src/qpid/broker/Broker.cpp +++ b/cpp/src/qpid/broker/Broker.cpp @@ -138,7 +138,7 @@ Broker::Broker(const Broker::Options& conf) : poller(new Poller), config(conf), managementAgent(conf.enableMgmt ? new ManagementAgent() : 0), - store(0), + store(new NullMessageStore), acl(0), dataDir(conf.noDataDir ? std::string() : conf.dataDir), queues(this), @@ -204,17 +204,11 @@ Broker::Broker(const Broker::Options& conf) : queues.setQueueEvents(&queueEvents); // Early-Initialize plugins - const Plugin::Plugins& plugins=Plugin::getPlugins(); - for (Plugin::Plugins::const_iterator i = plugins.begin(); - i != plugins.end(); - i++) - (*i)->earlyInitialize(*this); + Plugin::earlyInitAll(*this); // If no plugin store module registered itself, set up the null store. - if (store.get() == 0) { - boost::shared_ptr<MessageStore> p(new NullMessageStore()); - setStore (p); - } + if (NullMessageStore::isNullStore(store.get())) + setStore(); exchanges.declare(empty, DirectExchange::typeName); // Default exchange. @@ -259,10 +253,7 @@ Broker::Broker(const Broker::Options& conf) : } // Initialize plugins - for (Plugin::Plugins::const_iterator i = plugins.begin(); - i != plugins.end(); - i++) - (*i)->initialize(*this); + Plugin::initializeAll(*this); if (conf.queueCleanInterval) { queueCleaner.start(conf.queueCleanInterval * qpid::sys::TIME_SEC); @@ -304,6 +295,10 @@ boost::intrusive_ptr<Broker> Broker::create(const Options& opts) void Broker::setStore (boost::shared_ptr<MessageStore>& _store) { store.reset(new MessageStoreModule (_store)); + setStore(); +} + +void Broker::setStore () { queues.setStore (store.get()); dtxManager.setStore (store.get()); links.setStore (store.get()); |
