Author: aconway
Date: Tue May 22 18:11:20 2012
New Revision: 1341581

URL: http://svn.apache.org/viewvc?rev=1341581&view=rev
Log:
QPID-3603: Renamed brokers and public-brokers to brokers-url and public-url for 
clarity.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/ha/HaBroker.cpp
    qpid/trunk/qpid/cpp/src/qpid/ha/HaPlugin.cpp
    qpid/trunk/qpid/cpp/src/qpid/ha/management-schema.xml
    qpid/trunk/qpid/cpp/src/tests/ha_tests.py
    qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml
    qpid/trunk/qpid/tools/src/py/qpid-ha

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/HaBroker.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/HaBroker.cpp?rev=1341581&r1=1341580&r2=1341581&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/HaBroker.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/HaBroker.cpp Tue May 22 18:11:20 2012
@@ -35,8 +35,8 @@
 #include "qpid/sys/SystemInfo.h"
 #include "qmf/org/apache/qpid/ha/Package.h"
 #include "qmf/org/apache/qpid/ha/ArgsHaBrokerReplicate.h"
-#include "qmf/org/apache/qpid/ha/ArgsHaBrokerSetBrokers.h"
-#include "qmf/org/apache/qpid/ha/ArgsHaBrokerSetPublicBrokers.h"
+#include "qmf/org/apache/qpid/ha/ArgsHaBrokerSetBrokersUrl.h"
+#include "qmf/org/apache/qpid/ha/ArgsHaBrokerSetPublicUrl.h"
 #include "qmf/org/apache/qpid/ha/ArgsHaBrokerSetExpectedBackups.h"
 #include "qpid/log/Statement.h"
 
@@ -149,12 +149,12 @@ Manageable::status_t HaBroker::Managemen
           }
           break;
       }
-      case _qmf::HaBroker::METHOD_SETBROKERS: {
-          
setBrokerUrl(Url(dynamic_cast<_qmf::ArgsHaBrokerSetBrokers&>(args).i_url), l);
+      case _qmf::HaBroker::METHOD_SETBROKERSURL: {
+          
setBrokerUrl(Url(dynamic_cast<_qmf::ArgsHaBrokerSetBrokersUrl&>(args).i_url), 
l);
           break;
       }
-      case _qmf::HaBroker::METHOD_SETPUBLICBROKERS: {
-          
setClientUrl(Url(dynamic_cast<_qmf::ArgsHaBrokerSetPublicBrokers&>(args).i_url),
 l);
+      case _qmf::HaBroker::METHOD_SETPUBLICURL: {
+          
setClientUrl(Url(dynamic_cast<_qmf::ArgsHaBrokerSetPublicUrl&>(args).i_url), l);
           break;
       }
       case _qmf::HaBroker::METHOD_SETEXPECTEDBACKUPS: {
@@ -201,7 +201,7 @@ void HaBroker::setClientUrl(const Url& u
 void HaBroker::updateClientUrl(const sys::Mutex::ScopedLock&) {
     Url url = clientUrl.empty() ? brokerUrl : clientUrl;
     if (url.empty()) throw Url::Invalid("HA client URL is empty");
-    mgmtObject->set_publicBrokers(url.str());
+    mgmtObject->set_publicUrl(url.str());
     knownBrokers.clear();
     knownBrokers.push_back(url);
     QPID_LOG(debug, logPrefix << "Setting client URL to: " << url);
@@ -210,7 +210,7 @@ void HaBroker::updateClientUrl(const sys
 void HaBroker::setBrokerUrl(const Url& url, const sys::Mutex::ScopedLock& l) {
     if (url.empty()) throw Url::Invalid("HA broker URL is empty");
     brokerUrl = url;
-    mgmtObject->set_brokers(brokerUrl.str());
+    mgmtObject->set_brokersUrl(brokerUrl.str());
     if (backup.get()) backup->setBrokerUrl(brokerUrl);
     // Updating broker URL also updates defaulted client URL:
     if (clientUrl.empty()) updateClientUrl(l);

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/HaPlugin.cpp
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/HaPlugin.cpp?rev=1341581&r1=1341580&r2=1341581&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/HaPlugin.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/HaPlugin.cpp Tue May 22 18:11:20 2012
@@ -33,10 +33,10 @@ struct Options : public qpid::Options {
         addOptions()
             ("ha-cluster", optValue(settings.cluster, "yes|no"),
              "Join a HA active/passive cluster.")
-            ("ha-brokers", optValue(settings.brokerUrl,"URL"),
-             "URL that backup brokers use to connect and fail over.")
-            ("ha-public-brokers", optValue(settings.clientUrl,"URL"),
-             "URL that clients use to connect and fail over, defaults to 
ha-brokers.")
+            ("ha-brokers-url", optValue(settings.brokerUrl,"URL"),
+             "URL with address of each broker in the cluster.")
+            ("ha-public-url", optValue(settings.clientUrl,"URL"),
+             "URL advertized to clients to connect to the cluster.")
             ("ha-replicate",
              optValue(settings.replicateDefault, "LEVEL"),
             "Replication level for creating queues and exchanges if there is 
no qpid.replicate argument supplied. LEVEL is 'none', 'configuration' or 'all'")

Modified: qpid/trunk/qpid/cpp/src/qpid/ha/management-schema.xml
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/ha/management-schema.xml?rev=1341581&r1=1341580&r2=1341581&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/ha/management-schema.xml (original)
+++ qpid/trunk/qpid/cpp/src/qpid/ha/management-schema.xml Tue May 22 18:11:20 
2012
@@ -25,11 +25,11 @@
 
     <property name="status" type="sstr" desc="HA status: primary or backup"/>
 
-    <property name="brokers" type="sstr"
-             desc="Multiple-address URL used by HA brokers to connect to each 
other."/>
+    <property name="brokersUrl" type="sstr"
+             desc="URL with address of each broker in the cluster."/>
 
-    <property name="publicBrokers" type="sstr"
-             desc="Multiple-address URL used by clients to connect to the HA 
brokers."/>
+    <property name="publicUrl" type="sstr"
+             desc="URL advertized to clients to connect to the cluster."/>
 
     <property name="expectedBackups" type="uint16"
              desc="Number of HA backup brokers expected."/>
@@ -40,11 +40,11 @@
 
     <method name="promote" desc="Promote a backup broker to primary."/>
 
-    <method name="setBrokers" desc="Set URL for HA brokers to connect to each 
other.">
+    <method name="setBrokersUrl" desc="URL listing each broker in the 
cluster.">
       <arg name="url" type="sstr" dir="I"/>
     </method>
 
-    <method name="setPublicBrokers" desc="Set URL for clients to connect to  
HA brokers">
+    <method name="setPublicUrl" desc="URL advertized to clients.">
       <arg name="url" type="sstr" dir="I"/>
     </method>
 

Modified: qpid/trunk/qpid/cpp/src/tests/ha_tests.py
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/ha_tests.py?rev=1341581&r1=1341580&r2=1341581&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/ha_tests.py (original)
+++ qpid/trunk/qpid/cpp/src/tests/ha_tests.py Tue May 22 18:11:20 2012
@@ -39,7 +39,7 @@ class QmfHaBroker(object):
             raise Exception("HA module is not loaded on broker at %s"%address)
 
 class HaBroker(Broker):
-    def __init__(self, test, args=[], broker_url=None, ha_cluster=True,
+    def __init__(self, test, args=[], brokers_url=None, ha_cluster=True,
                  ha_replicate="all", **kwargs):
         assert BrokerTest.ha_lib, "Cannot locate HA plug-in"
         args = copy(args)
@@ -50,7 +50,7 @@ class HaBroker(Broker):
                  "--ha-cluster=%s"%ha_cluster]
         if ha_replicate is not None:
             args += [ "--ha-replicate=%s"%ha_replicate ]
-        if broker_url: args.extend([ "--ha-brokers", broker_url ])
+        if brokers_url: args += [ "--ha-brokers-url", brokers_url ]
         Broker.__init__(self, test, args, **kwargs)
         self.qpid_ha_path=os.path.join(os.getenv("PYTHON_COMMANDS"), "qpid-ha")
         assert os.path.exists(self.qpid_ha_path)
@@ -62,8 +62,8 @@ class HaBroker(Broker):
     def qpid_ha(self, args): self.qpid_ha_script.main(["", "-b", 
self.host_port()]+args)
 
     def promote(self): self.qpid_ha(["promote"])
-    def set_client_url(self, url): self.qpid_ha(["set", "--public-brokers", 
url])
-    def set_broker_url(self, url): self.qpid_ha(["set", "--brokers", url])
+    def set_client_url(self, url): self.qpid_ha(["set", "--public-url", url])
+    def set_brokers_url(self, url): self.qpid_ha(["set", "--brokers-url", url])
     def replicate(self, from_broker, queue): self.qpid_ha(["replicate", 
from_broker, queue])
     def ha_status(self): QmfHaBroker(self.host_port()).ha_broker.status
 
@@ -134,7 +134,7 @@ class HaCluster(object):
 
     def update_urls(self):
         self.url = ",".join([b.host_port() for b in self])
-        for b in self: b.set_broker_url(self.url)
+        for b in self: b.set_brokers_url(self.url)
 
     def connect(self, i):
         """Connect with reconnect_urls"""
@@ -149,7 +149,7 @@ class HaCluster(object):
     def restart(self, i):
         b = self._brokers[i]
         self._brokers[i] = HaBroker(
-            self.test, name=self.next_name(), port=b.port(), 
broker_url=self.url,
+            self.test, name=self.next_name(), port=b.port(), 
brokers_url=self.url,
             **self.kwargs)
 
     def bounce(self, i, promote_next=True):
@@ -238,7 +238,7 @@ class ReplicationTests(BrokerTest):
 
         # Create config, send messages before starting the backup, to test 
catch-up replication.
         setup(p, "1", primary)
-        backup  = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup  = HaBroker(self, name="backup", 
brokers_url=primary.host_port())
         # Create config, send messages after starting the backup, to test 
steady-state replication.
         setup(p, "2", primary)
 
@@ -276,10 +276,10 @@ class ReplicationTests(BrokerTest):
         s = p.sender("q;{create:always}")
         for m in [str(i) for i in range(0,10)]: s.send(m)
         s.sync()
-        backup1 = HaBroker(self, name="backup1", 
broker_url=primary.host_port())
+        backup1 = HaBroker(self, name="backup1", 
brokers_url=primary.host_port())
         for m in [str(i) for i in range(10,20)]: s.send(m)
         s.sync()
-        backup2 = HaBroker(self, name="backup2", 
broker_url=primary.host_port())
+        backup2 = HaBroker(self, name="backup2", 
brokers_url=primary.host_port())
         for m in [str(i) for i in range(20,30)]: s.send(m)
         s.sync()
 
@@ -319,7 +319,7 @@ class ReplicationTests(BrokerTest):
         """Verify that backups rejects connections and that fail-over works in 
python client"""
         primary = HaBroker(self, name="primary", expect=EXPECT_EXIT_FAIL)
         primary.promote()
-        backup = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup = HaBroker(self, name="backup", brokers_url=primary.host_port())
         # Check that backup rejects normal connections
         try:
             backup.connect().session()
@@ -344,7 +344,7 @@ class ReplicationTests(BrokerTest):
         """Verify that failover works in the C++ client."""
         primary = HaBroker(self, name="primary", expect=EXPECT_EXIT_FAIL)
         primary.promote()
-        backup = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup = HaBroker(self, name="backup", brokers_url=primary.host_port())
         url="%s,%s"%(primary.host_port(), backup.host_port())
         primary.connect().session().sender("q;{create:always}")
         backup.wait_backup("q")
@@ -437,7 +437,7 @@ class ReplicationTests(BrokerTest):
         """Verify that we replicate to an LVQ correctly"""
         primary  = HaBroker(self, name="primary")
         primary.promote()
-        backup = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup = HaBroker(self, name="backup", brokers_url=primary.host_port())
         s = primary.connect().session().sender("lvq; {create:always, 
node:{x-declare:{arguments:{'qpid.last_value_queue_key':lvq-key}}}}")
         def send(key,value): 
s.send(Message(content=value,properties={"lvq-key":key}))
         for kv in 
[("a","a-1"),("b","b-1"),("a","a-2"),("a","a-3"),("c","c-1"),("c","c-2")]:
@@ -454,7 +454,7 @@ class ReplicationTests(BrokerTest):
         """Test replication with the ring queue policy"""
         primary  = HaBroker(self, name="primary")
         primary.promote()
-        backup = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup = HaBroker(self, name="backup", brokers_url=primary.host_port())
         s = primary.connect().session().sender("q; {create:always, 
node:{x-declare:{arguments:{'qpid.policy_type':ring, 'qpid.max_count':5}}}}")
         for i in range(10): s.send(Message(str(i)))
         backup.assert_browse_backup("q", [str(i) for i in range(5,10)])
@@ -463,7 +463,7 @@ class ReplicationTests(BrokerTest):
         """Test replication with the reject queue policy"""
         primary  = HaBroker(self, name="primary")
         primary.promote()
-        backup = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup = HaBroker(self, name="backup", brokers_url=primary.host_port())
         s = primary.connect().session().sender("q; {create:always, 
node:{x-declare:{arguments:{'qpid.policy_type':reject, 'qpid.max_count':5}}}}")
         try:
             for i in range(10): s.send(Message(str(i)), sync=False)
@@ -474,7 +474,7 @@ class ReplicationTests(BrokerTest):
         """Verify priority queues replicate correctly"""
         primary  = HaBroker(self, name="primary")
         primary.promote()
-        backup = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup = HaBroker(self, name="backup", brokers_url=primary.host_port())
         session = primary.connect().session()
         s = session.sender("priority-queue; {create:always, 
node:{x-declare:{arguments:{'qpid.priorities':10}}}}")
         priorities = [8,9,5,1,2,2,3,4,9,7,8,9,9,2]
@@ -489,7 +489,7 @@ class ReplicationTests(BrokerTest):
         """Verify priority queues replicate correctly"""
         primary  = HaBroker(self, name="primary")
         primary.promote()
-        backup = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup = HaBroker(self, name="backup", brokers_url=primary.host_port())
         session = primary.connect().session()
         levels = 8
         priorities = 
[4,5,3,7,8,8,2,8,2,8,8,16,6,6,6,6,6,6,8,3,5,8,3,5,5,3,3,8,8,3,7,3,7,7,7,8,8,8,2,3]
@@ -508,7 +508,7 @@ class ReplicationTests(BrokerTest):
     def test_priority_ring(self):
         primary  = HaBroker(self, name="primary")
         primary.promote()
-        backup = HaBroker(self, name="backup", broker_url=primary.host_port())
+        backup = HaBroker(self, name="backup", brokers_url=primary.host_port())
         s = primary.connect().session().sender("q; {create:always, 
node:{x-declare:{arguments:{'qpid.policy_type':ring, 'qpid.max_count':5, 
'qpid.priorities':10}}}}")
         priorities = [8,9,5,1,2,2,3,4,9,7,8,9,9,2]
         for p in priorities: s.send(Message(priority=p))
@@ -553,11 +553,11 @@ class ReplicationTests(BrokerTest):
 
         primary  = HaBroker(self, name="primary")
         primary.promote()
-        backup1 = HaBroker(self, name="backup1", 
broker_url=primary.host_port())
+        backup1 = HaBroker(self, name="backup1", 
brokers_url=primary.host_port())
         c = primary.connect()
         for t in tests: t.send(c) # Send messages, leave one unacknowledged.
 
-        backup2 = HaBroker(self, name="backup2", 
broker_url=primary.host_port())
+        backup2 = HaBroker(self, name="backup2", 
brokers_url=primary.host_port())
         # Wait for backups to catch up.
         for t in tests:
             t.wait(self, backup1)

Modified: qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml?rev=1341581&r1=1341580&r2=1341581&view=diff
==============================================================================
--- qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml 
(original)
+++ qpid/trunk/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml Tue May 
22 18:11:20 2012
@@ -192,11 +192,11 @@ under the License.
          </row>
          <row>
            <entry>
-             <literal>--ha-brokers <replaceable>URL</replaceable></literal>
+             <literal>--ha-brokers-url <replaceable>URL</replaceable></literal>
            </entry>
            <entry>
              <para>
-               The URL
+               A URL listing each broker in the cluster.
                <footnote>
                  <para>
                  The full format of the URL is given by this grammar:
@@ -209,24 +209,28 @@ under the License.
                  </programlisting>
                  </para>
                </footnote>
-               used by brokers to connect to each other. If you use a virtual 
IP address
-               then this is a single address, for example
-               <literal>amqp:20.0.20.200</literal>. If you do not use a 
virtual IP
-               address then the URL must list all the addresses of brokers in 
the
-               cluster, for example <literal>amqp:node1,node2,node3</literal>
+               It is used by brokers to connect to each other. This URL must 
explicitly
+               list each broker, it cannot be a virtual IP address.
+               For example 
<literal>amqp:node1.exaple.com,node2.exaple.com,node3.exaple.com</literal>
              </para>
            </entry>
          </row>
          <row>
-           <entry><literal>--ha-public-brokers 
<replaceable>URL</replaceable></literal> </entry>
+           <entry><literal>--ha-public-url 
<replaceable>URL</replaceable></literal> </entry>
            <entry>
              <para>
-               The URL used by clients to connect to the brokers. This has the 
same
-               format as the <literal>--ha-brokers</literal> URL above.
+               The URL that is advertized to clients. This has the same
+               format as the <literal>--ha-brokers-url</literal> URL above.
              </para>
              <para>
-               If this option is not set, clients will use the same URL as 
brokers.
-               This option allows you to put client traffic on a different 
network from
+               This URL can contain a list of all the brokers'
+               addresses or a single virtual IP address.  A virtual
+               IP address is recommended as it simplifies deployment
+               and hides changes to the cluster membership from
+               clients.
+             </para>
+             <para>
+               You can use this option to put client traffic on a different 
network from
                broker traffic, which is recommended.
              </para>
            </entry>
@@ -237,7 +241,7 @@ under the License.
            <entry>
              <para> 
                Specifies whether queues and exchanges are replicated by 
default.
-               For details see <xref linkend="creating-replicated"/>
+               For details see <xref linkend="ha-creating-replicated"/>
              </para>
            </entry>
          </row>
@@ -256,7 +260,7 @@ under the License.
     </table>
     <para>
       To configure a HA cluster you must set at least 
<literal>ha-cluster</literal> and
-      <literal>ha-brokers</literal>.
+      <literal>ha-brokers-url</literal>.
     </para>
   </section>
 
@@ -272,7 +276,7 @@ under the License.
       The resource manager is responsible for starting the 
<command>qpidd</command> broker
       on each node in the cluster. The resource manager 
<firstterm>promotes</firstterm>
       one of the brokers to be the primary. The other brokers connect to the 
primary as
-      backups, using the URL provided in the <literal>ha-brokers</literal> 
configuration
+      backups, using the URL provided in the <literal>ha-brokers-url</literal> 
configuration
       option.
     </para>
     <para>
@@ -406,8 +410,8 @@ NOTE: fencing is not shown, you must con
     </para>
     <programlisting>
       ha-cluster=yes
-      ha-brokers=20.0.20.200
-      ha-public-brokers=20.0.10.200
+      ha-brokers-url=20.0.20.200
+      ha-public-url=20.0.10.200
     </programlisting>
     <para>
       This configuration specifies that backup brokers will use 20.0.20.200

Modified: qpid/trunk/qpid/tools/src/py/qpid-ha
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/tools/src/py/qpid-ha?rev=1341581&r1=1341580&r2=1341581&view=diff
==============================================================================
--- qpid/trunk/qpid/tools/src/py/qpid-ha (original)
+++ qpid/trunk/qpid/tools/src/py/qpid-ha Tue May 22 18:11:20 2012
@@ -93,30 +93,31 @@ class SetCmd(Command):
         Command.__init__(self, "set", "Set HA configuration settings")
         def add(optname, metavar, type, help):
             self.op.add_option(optname, metavar=metavar, type=type, help=help, 
action="store")
-        add("--brokers", "<url>", "string", "HA brokers use <url> to connect 
to each other")
-        add("--public-brokers", "<url>", "string", "Clients use <url> to 
connect to HA brokers")
+        add("--brokers-url", "<url>", "string", "URL with address of each 
broker in the cluster. Used by brokers to connect to each other.")
+        add("--public-url", "<url>", "string", "URL advertised to clients to 
connect to the cluster. May be a list or a VIP.")
         add("--backups", "<n>", "int", "Expect <n> backups to be running"),
 
     def do_execute(self, qmf_broker, ha_broker, opts, args):
-        if (opts.brokers): qmf_broker._method("setBrokers", 
{"url":opts.brokers}, HA_BROKER)
-        if (opts.public_brokers): qmf_broker._method("setPublicBrokers", 
{"url":opts.public_brokers}, HA_BROKER)
+        if (opts.brokers_url): qmf_broker._method("setBrokersUrl", 
{"url":opts.brokers_url}, HA_BROKER)
+        if (opts.public_url): qmf_broker._method("setPublicUrl", 
{"url":opts.public_url}, HA_BROKER)
         if (opts.backups): qmf_broker._method("setExpectedBackups", 
{"expectedBackups":opts.backups}, HA_BROKER)
 
 SetCmd()
 
 class QueryCmd(Command):
     def __init__(self):
-        Command.__init__(self, "query", "Print HA configuration settings")
+        Command.__init__(self, "query", "Print HA configuration and status")
 
     def do_execute(self, qmf_broker, ha_broker, opts, args):
         hb = ha_broker
         for x in [("Status:", hb.status),
-                  ("Brokers URL:", hb.brokers),
-                  ("Public URL:", hb.publicBrokers),
+                  ("Brokers URL:", hb.brokersUrl),
+                  ("Public URL:", hb.publicUrl),
                   ("Expected Backups:", hb.expectedBackups),
                   ("Replicate: ", hb.replicateDefault)
                   ]:
             print "%-20s %s"%(x[0], x[1])
+
 QueryCmd()
 
 def print_usage(prog):



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to