Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C5003E1B2 for ; Mon, 14 Jan 2013 20:07:38 +0000 (UTC) Received: (qmail 44008 invoked by uid 500); 14 Jan 2013 20:07:38 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 43985 invoked by uid 500); 14 Jan 2013 20:07:38 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 43976 invoked by uid 99); 14 Jan 2013 20:07:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jan 2013 20:07:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jan 2013 20:07:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CCD1423889BB; Mon, 14 Jan 2013 20:07:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1433089 - in /qpid/trunk/qpid/cpp/src/qpid/broker: Link.cpp Link.h LinkRegistry.cpp LinkRegistry.h Date: Mon, 14 Jan 2013 20:07:15 -0000 To: commits@qpid.apache.org From: aconway@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130114200715.CCD1423889BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: aconway Date: Mon Jan 14 20:07:15 2013 New Revision: 1433089 URL: http://svn.apache.org/viewvc?rev=1433089&view=rev Log: QPID-4514: Clean up cluster code: remove passive links. Remove passive code from Link and LinkRegistry, only used by defunct cluster code. Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp qpid/trunk/qpid/cpp/src/qpid/broker/Link.h qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.h Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp?rev=1433089&r1=1433088&r2=1433089&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/Link.cpp Mon Jan 14 20:07:15 2013 @@ -171,12 +171,8 @@ Link::Link(const string& _name, agent->addObject(mgmtObject, 0, durable); } } - if (links->isPassive()) { - setStateLH(STATE_PASSIVE); - } else { - setStateLH(STATE_WAITING); - startConnectionLH(); - } + setStateLH(STATE_WAITING); + startConnectionLH(); broker->getTimer().add(timerTask); if (failover) { @@ -217,7 +213,6 @@ void Link::setStateLH (int newState) case STATE_OPERATIONAL : mgmtObject->set_state("Operational"); break; case STATE_FAILED : mgmtObject->set_state("Failed"); break; case STATE_CLOSED : mgmtObject->set_state("Closed"); break; - case STATE_PASSIVE : mgmtObject->set_state("Passive"); break; } } @@ -241,7 +236,6 @@ void Link::startConnectionLH () void Link::established(Connection* c) { - if (state == STATE_PASSIVE) return; stringstream addr; addr << host << ":" << port; QPID_LOG (info, "Inter-broker link established to " << addr.str()); @@ -364,7 +358,7 @@ void Link::closed(int, std::string text) } active.clear(); - if (state != STATE_FAILED && state != STATE_PASSIVE) + if (state != STATE_FAILED) { setStateLH(STATE_WAITING); mgmtObject->set_lastError (text); @@ -713,22 +707,6 @@ Manageable::status_t Link::ManagementMet return Manageable::STATUS_UNKNOWN_METHOD; } -void Link::setPassive(bool passive) -{ - Mutex::ScopedLock mutex(lock); - if (passive) { - setStateLH(STATE_PASSIVE); - } else { - if (state == STATE_PASSIVE) { - setStateLH(STATE_WAITING); - } else { - QPID_LOG(warning, "Ignoring attempt to activate non-passive link " - << host << ":" << port); - } - } -} - - /** utility to clean up connection resources correctly */ void Link::closeConnection( const std::string& reason) { Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Link.h URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Link.h?rev=1433089&r1=1433088&r2=1433089&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/Link.h (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/Link.h Mon Jan 14 20:07:15 2013 @@ -98,7 +98,6 @@ class Link : public PersistableConfig, p static const int STATE_OPERATIONAL = 3; static const int STATE_FAILED = 4; static const int STATE_CLOSED = 5; - static const int STATE_PASSIVE = 6; static const uint32_t MAX_INTERVAL = 32; @@ -165,7 +164,6 @@ class Link : public PersistableConfig, p std::string getPassword() { return password; } Broker* getBroker() { return broker; } - void setPassive(bool p); bool isConnecting() const { return state == STATE_CONNECTING; } // PersistableConfig: Modified: qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp?rev=1433089&r1=1433088&r2=1433089&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp Mon Jan 14 20:07:15 2013 @@ -44,7 +44,7 @@ namespace _qmf = qmf::org::apache::qpid: // factored: The persistence element should be factored separately LinkRegistry::LinkRegistry () : broker(0), - parent(0), store(0), passive(false), + parent(0), store(0), realm("") { } @@ -61,7 +61,7 @@ class LinkRegistryConnectionObserver : p LinkRegistry::LinkRegistry (Broker* _broker) : broker(_broker), - parent(0), store(0), passive(false), + parent(0), store(0), realm(broker->getOptions().realm) { broker->getConnectionObservers().add( @@ -414,16 +414,4 @@ std::string LinkRegistry::getAuthIdentit return link->getUsername(); } - -void LinkRegistry::setPassive(bool p) -{ - Mutex::ScopedLock locker(lock); - passive = p; - if (passive) { QPID_LOG(info, "Passivating links"); } - else { QPID_LOG(info, "Activating links"); } - for (LinkMap::iterator i = links.begin(); i != links.end(); i++) { - i->second->setPassive(passive); - } -} - }} // namespace qpid::broker Modified: qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.h URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.h?rev=1433089&r1=1433088&r2=1433089&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.h (original) +++ qpid/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.h Mon Jan 14 20:07:15 2013 @@ -53,7 +53,6 @@ namespace broker { Broker* broker; management::Manageable* parent; MessageStore* store; - bool passive; std::string realm; boost::shared_ptr findLink(const std::string& key); @@ -144,15 +143,6 @@ namespace broker { QPID_BROKER_EXTERN std::string getPassword (const std::string& key); QPID_BROKER_EXTERN std::string getHost (const std::string& key); QPID_BROKER_EXTERN uint16_t getPort (const std::string& key); - - /** - * Called to alter passive state. In passive state the links - * and bridges managed by a link registry will be recorded and - * updated but links won't actually establish connections and - * bridges won't therefore pull or push any messages. - */ - QPID_BROKER_EXTERN void setPassive(bool); - QPID_BROKER_EXTERN bool isPassive() { return passive; } }; } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org