Review Board 1.7.22


Modify Bridge & Link indexing to use explicit names.

Review Request #3546 - Created Jan. 19, 2012 and discarded

Kenneth Giusti
qpid-3767
Reviewers
qpid
aconway, gordon, mick, tross
qpid
This patch modifies the way the broker's Link and Bridge objects are identified and managed.  Specifically:

1) both Bridge and Links are now identified by explict names assigned by management, rather than destination host/port info.
   - names beginning with the prefix "qpid." are reserved for qpidd internal use.
   - for backward compatibility, if no name is assigned on creation, the broker will generate a name based on UUID
2) the corresponding QMF objects have been updated accordingly, with the additions of:
   - the QMF Link object has been updated to provide a reference to the corresponding Connection
   - the QMF Link object has been modified to allow the host/port/connectionRef to change on failover
   - the QMF Bridge object has been modified to allow the Channel identifier to change (allowing Bridges to be reassigned to different links in the future)
3) Links/Bridges may now be created/deleted via the QMF Broker's generic "create" and "delete" methods
4) Some consolidation of the Link/Bridge creation APIs, specifically:
   - Link/Bridges are created via calls to the LinkRegistry's "declare()" methods
   - Link/Bridges are removed by calling their corresponding "destroy()" methods

More importantly, the above changes make it possible to create multiple Links between the same two brokers.  This can be done by creating Links to the same destinations with different names.  This is a change from the existing behavior, which uses the destination host/port as the unique Link identifier.
This patch fails to pass some of the cluster tests - I'm investigating this now.  All non-cluster federation tests where passing (prior to my latest rebase).

Work remains, but I wanted to get this patch out for discussion before going much farther.
/trunk/qpid/cpp/src/qpid/broker/Bridge.h
Revision 1233125 New Change
[20] 46 lines
[+20] [+] class LinkRegistry;
47
{
47
{
48
public:
48
public:
49
    typedef boost::shared_ptr<Bridge> shared_ptr;
49
    typedef boost::shared_ptr<Bridge> shared_ptr;
50
    typedef boost::function<void(Bridge*)> CancellationListener;
50
    typedef boost::function<void(Bridge*)> CancellationListener;
51

    
   
51

   
52
    Bridge(Link* link, framing::ChannelId id, CancellationListener l,
52
    Bridge(const std::string& name, Link* link, framing::ChannelId id, CancellationListener l,
53
           const qmf::org::apache::qpid::broker::ArgsLinkBridge& args);
53
           const qmf::org::apache::qpid::broker::ArgsLinkBridge& args);
54
    ~Bridge();
54
    ~Bridge();

    
   
55
    /** initiate teardown of the bridge */

    
   
56
    void destroy();
55

    
   
57

   
56
    void create(Connection& c);
58
    void create(Connection& c);
57
    void cancel(Connection& c);
59
    void cancel(Connection& c);
58
    void closed();
60
    void closed();
59
    void destroy();
61
    bool isDurable() const { return args.i_durable; }
60
    bool isDurable() { return args.i_durable; }
62
    Link *getLink() const { return link; }
61

    
   
63
    const std::string getSrc() const { return args.i_src; }

    
   
64
    const std::string getDest() const { return args.i_dest; }

    
   
65
    const std::string getKey() const { return args.i_key; }
62
    bool hasSessionFailed() const;
66
    bool hasSessionFailed() const;
63

    
   
67

   
64
    management::ManagementObject* GetManagementObject() const;
68
    management::ManagementObject* GetManagementObject() const;
65
    management::Manageable::status_t ManagementMethod(uint32_t methodId,
69
    management::Manageable::status_t ManagementMethod(uint32_t methodId,
66
                                                      management::Args& args,
70
                                                      management::Args& args,
[+20] [20] 47 lines
/trunk/qpid/cpp/src/qpid/broker/Bridge.cpp
Revision 1233125 New Change
 
/trunk/qpid/cpp/src/qpid/broker/Broker.cpp
Revision 1233125 New Change
 
/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
Revision 1233125 New Change
 
/trunk/qpid/cpp/src/qpid/broker/Link.h
Revision 1233125 New Change
 
/trunk/qpid/cpp/src/qpid/broker/Link.cpp
Revision 1233125 New Change
 
/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.h
Revision 1233125 New Change
 
/trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp
Revision 1233125 New Change
 
/trunk/qpid/cpp/src/tests/federation.py
Revision 1233125 New Change
 
/trunk/qpid/specs/management-schema.xml
Revision 1233125 New Change
 
  1. /trunk/qpid/cpp/src/qpid/broker/Bridge.h: Loading...
  2. /trunk/qpid/cpp/src/qpid/broker/Bridge.cpp: Loading...
  3. /trunk/qpid/cpp/src/qpid/broker/Broker.cpp: Loading...
  4. /trunk/qpid/cpp/src/qpid/broker/Connection.cpp: Loading...
  5. /trunk/qpid/cpp/src/qpid/broker/Link.h: Loading...
  6. /trunk/qpid/cpp/src/qpid/broker/Link.cpp: Loading...
  7. /trunk/qpid/cpp/src/qpid/broker/LinkRegistry.h: Loading...
  8. /trunk/qpid/cpp/src/qpid/broker/LinkRegistry.cpp: Loading...
  9. /trunk/qpid/cpp/src/tests/federation.py: Loading...
  10. /trunk/qpid/specs/management-schema.xml: Loading...