summaryrefslogtreecommitdiff
path: root/cpp/src/tests/Cluster.h
Commit message (Collapse)AuthorAgeFilesLines
* Cluster code fixed for changes in codebase.Alan Conway2008-02-011-73/+0
| | | | | | | | | | | - Using SessionManager::Observer - Better ais test setup, only need to be member of ais group. - Update cluster_client - SessionState holds handler chains. - Cluster frames include next handler ptr. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@617582 13f79535-47bb-0310-9956-ffa450edef68
* client/BlockingQueue.h, sys/ConcurrentQueue.h: merged to sys/BlockingQueue.hAlan Conway2007-10-291-4/+2
| | | | | | | | | - updated all users qpid/Exception.h: Removed unimplemented clone() function. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@589857 13f79535-47bb-0310-9956-ffa450edef68
* - Update cluster code to work with new FrameHandlerAlan Conway2007-08-301-1/+1
| | | | | | | | - Update ClassifierHandler to use Visitor rather than map. - Replace heap allocation in cluster classes with boost::optional. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@571246 13f79535-47bb-0310-9956-ffa450edef68
* AMQBodies are no longer allocated on the heap and passed with shared_ptr.Alan Conway2007-08-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | AMQFrame contains a boost::variant of AMQHeaderBody,AMQContentBody, AMQHeatbeatBody, and MethodHolder. A variant is basically a type-safe union, it can allocate any of the types in-place. MethodHolder contains a Blob, a less sophisticated kind of variant, which can contain any of the concrete method body types. Using variants for all the method types causes outrageous compile times and bloated library symbol names. Blob lacks some of the finer features of variant and needs help from generated code. For now both are hidden to the rest of the code base behind AMQFrame and MethodBody classes so if/when we decide to settle on just one "variant" type solution we can do so. This commit touches nearly 100 files, mostly converting method signatures with shared_ptr<FooBody> to FooBody* or FooBody&, and converting stored shared_ptr<AMQBody> to AMQFrame and share_ptr<AMQMethodBody> to MethodHolder. There is one outstanding client memory leak, which I will fix in my next commit. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@566822 13f79535-47bb-0310-9956-ffa450edef68
* Drop SessionFrame, UUID is not required and more efficient to transmit plainAlan Conway2007-07-271-2/+1
| | | | | | | AMQFrames. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@560356 13f79535-47bb-0310-9956-ffa450edef68
* * README: Instructions for openais install.Alan Conway2007-07-261-23/+7
| | | | | | | | | | | | | | * configure.ac: Enable clustering if suitable openais is present. * src/tests/Cluster.cpp, .h, Cluster_child: Updated for 0-10 * src/qpid/sys/ConcurrentQueue.h: Added waitPop() * src/Makefile.am, src/qpid/sys/ThreadSafeQueue.h, ProducerConsumer.h: Removed unused code, ConcurrentQueue provides same functionality. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@559859 13f79535-47bb-0310-9956-ffa450edef68
* * Summary:Alan Conway2007-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wiring (declare/delete/bind) is replicated via AIS. - TestOptions includes all logging options. - Logger automatically parses env vars so logging can be enabled for any program linked with libqpidcommon e.g. by setting QPID_TRACE=1. * src/qpid/cluster/SessionManager.cpp: Handle frames from cluster - Forward to BrokerAdapter for execution. - Suppress responses in proxy. * src/tests/TestOptions.h (Options): Logging options, --help option. * src/qpid/client/ClientConnection.cpp: Removed log initialization. Logs are initialized either in TestOptions or automatically from env vars, e.g. QPID_TRACE, * src/qpid/QpidError.h (class QpidError): Initialize Exception in constructor so messages can be logged. * src/qpid/framing/ChannelAdapter.h: Made send() virtual. * src/tests/Cluster_child.cpp: UUID corrected. * src/qpid/broker/Broker.cpp: Pass chains to updater by ref. * src/qpid/Options.cpp (parse): Fix log settings from environment. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@559171 13f79535-47bb-0310-9956-ffa450edef68
* * src/tests/cluster.mk: Enable cluster test.Alan Conway2007-07-231-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | * src/tests/Cluster.h (class TestHandler): Fixed race in TestHandler::waitFor * src/tests/Cluster.cpp - Allow separate start of parent and child processes. * src/qpid/Options.cpp (parse): Skip argv parsing if argc=0. * src/qpid/cluster/Cluster.cpp (configChange): assert group name. * src/qpid/cluster/Cpg.cpp, .h: Additional logging * src/qpid/framing/AMQFrame.cpp: Initialize all fields in ctor, avoid valgrind warning. * src/qpid/log/Logger.cpp: Initialize singleton automatically from environment so logging can be used on tests. * src/qpid/sys/Time.h: Avoid overflow in AbsTime(t, TIME_INFINITE) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@558710 13f79535-47bb-0310-9956-ffa450edef68
* * Summary:Alan Conway2007-07-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Connect cluster handlers into broker handler chains. - Progress on wiring replication. * src/tests/cluster.mk: Temporarily disabled Cluster test. * src/tests/Cluster.h, cpp, Cluster_child.cpp: Updated to use UUIDs. * src/qpidd.cpp: - Load optional libs (cluster) - Include plugin config in options.parse. * src/qpid/cluster/SessionManager.h: - Create sessions, update handler chains (as HandlerUpdater) - Handle frames from cluster. * src/qpid/cluster/ClusterPlugin.h, .cpp: - renamed from ClusterPluginProvider - Create and connect Cluster and SessionManager. - Register SessionManager as HandlerUpdater. * src/qpid/cluster/Cluster.h, .cpp: Refactor as SessionFrameHandler. * src/qpid/broker/Connection.cpp: Apply HandlerUpdaters. * src/qpid/broker/Broker.h, .cpp: - Initialize plugins - Apply HandlerUpdaters * src/qpid/Plugin.h, .cpp: Simplified plugin framework. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@557788 13f79535-47bb-0310-9956-ffa450edef68
* * src/qpid/cluster/SessionFrame.cpp, .h: Wrap AMQFrame withAlan Conway2007-07-051-11/+10
| | | | | | | | | | | | | | | | | | | | session UUID and direction. * src/qpid/cluster/Cluster.cpp, .h: Use SessionFrame. * src/qpid/framing/AMQFrame.h, .cpp: Added setBody(), inline getBody() * src/qpid/framing/Uuid.h, .cpp: Clean up constructors, inline. * src/qpid/framing/Buffer.h: Put/get byte*, size_T. * src/qpid/cluster/SessionManager.cpp, .h: - Maintain the session map. - Handle frames from cluster, dispatch to proper channels. - Implement HandlerUpdater for new channels and maintains git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@553543 13f79535-47bb-0310-9956-ffa450edef68
* 2007-06-30 <aconway@redhat.com>Alan Conway2007-07-021-24/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | * src/qpid/cluster/Cluster.cpp: Refactor - expose 4 handler points for all traffic to/from cluster. Removed HandlerUpdater functionality, separate class. Cluster only deals with membership and connecting the 4 handler points to CPG multicast. * src/tests/cluster.mk: Dropped newgrp ais wrapper scripts, its much simpler if the user just does "newgrp ais" before building. * src/tests/ais_check: Test script to check if users gid is ais and give clear notice if not. * src/tests/Cluster.cpp: Updated for changes to Cluster. * src/qpid/cluster/Cpg.cpp: Better messages for common errors. * Handler.h: Remove nextHandler() minor convenience is outweighted by risk of undetected errors if handlers that expect next() to be set are called when it's not set. * src/qpid/cluster/Cpg.cpp: Added logging. Replaced boost::function with traditional virtual interface (nasty stack traces.) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@552614 13f79535-47bb-0310-9956-ffa450edef68
* * Summary:Alan Conway2007-06-291-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Improved plugin framework and HandlerUpdater interface. - Cluster handlers for traffic to/from cluster. - Cluster HandlerUpdater configures channel chains for cluster. - Cluster PluginProvider registers cluster objects with broker. * src/qpid/framing/AMQFrame.h: Made data members public. Handlers need to be able to modify frame data, getters/setters are just a nuisance here. * src/tests/Cluster.cpp: Updated for cluster changes, using handlers instead of friendship to hook test into Cluster code. * src/qpid/framing/amqp_types.h: Added CHANNEL_MAX and CHANNEL_HIGH_BIT constants. * src/qpid/framing/HandlerUpdater.h: Renamed ChannelInitializer, broke dependency on broker channel types. * src/qpid/framing/Handler.h: Added constructors and nextHandler() * src/qpid/framing/AMQFrame.h (class AMQFrame): Inlined getChannel() * src/qpid/cluster/ClusterPluginProvider.cpp: Provider for cluster plugins. * src/qpid/cluster/Cluster.cpp: Use ChannelManager. Factor out plugin details to ClusterPluginProvider. * src/qpid/cluster/ChannelManager.h: Insert cluster handlers into channel chains, route frames between cluster and channels. * src/qpid/broker/BrokerAdapter.cpp (startOk): use CHANNEL_MAX constant. * src/qpid/broker/Broker.cpp: - Refactored for new plugin framework. - Added getUrl(). * src/qpid/Url.h: Added constructor from Address. * src/qpid/Plugin.h: Generalized plugin framework, broke dependency on Broker interfaces. We may want to use plug-ins for clients also at some point. * src/tests/run_test: Fix bug when VALGRIND is not set. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@551981 13f79535-47bb-0310-9956-ffa450edef68
* 2007-06-25 <aconway@redhat.com>Alan Conway2007-06-261-0/+83
Cluster class implementing cluster membership map. * src/qpid/cluster/Cluster.cpp: Cluster membership implementation. * src/qpid/cluster/Cpg.cpp: Support for boost::function callbacks. * src/tests/Url.cpp: Implements AMQP-95 URL format. * xml/cluster.xml: Cluster join method. Build/packaging * README: Remove mention of openais till clustering is functional. For now it is optional and we depend on an unpackaged version. * configure.ac: Check openais has cpg_local_get(). * Makefile.am: Added cluster.xml to EXTRA_DIST. * src/generate.sh: add cluster.xml to codegen. * src/tests/Makefile.am: - Generate individual "sudo -u ais" wrappers for openais tests. - Drop "unit" directory, all unit tests in "tests" directory Minor changes: * src/qpid/sys/posix/Socket.cpp: * src/qpid/sys/posix/PosixAcceptor.cpp: * src/qpid/sys/posix/EventChannelAcceptor.cpp: * src/qpid/sys/apr/APRAcceptor.cpp: * src/qpid/sys/Acceptor.h (getHost): Added getHost() * src/tests/.valgrind.supp-default: Suppress benign valgrind warning in libcpg. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@550658 13f79535-47bb-0310-9956-ffa450edef68