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 2013/01/14 21:07:15 UTC
svn commit: r1433089 - in /qpid/trunk/qpid/cpp/src/qpid/broker: Link.cpp
Link.h LinkRegistry.cpp LinkRegistry.h
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<Link> 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