|
zookeeper-cpp
ZooKeeper Client for C++
|
Create and manage a group of server instances on this local machine (most likely in a single ensemble). More...
#include <zk/server/server_group.hpp>
Classes | |
| struct | info |
Public Member Functions | |
| server_group () noexcept | |
| Create an empty server group. More... | |
| server_group (server_group &&) noexcept | |
| Move-construct a server group. More... | |
| server_group & | operator= (server_group &&) noexcept |
| Move-assign a server group. More... | |
| const std::string & | get_connection_string () |
| Get a connection string which can connect to any the servers in the group. More... | |
| void | start_all_servers (const classpath &packages) |
| Start all servers in the group. More... | |
| std::size_t | size () const |
| How many servers are in this group? More... | |
Static Public Member Functions | |
| static server_group | make_ensemble (std::size_t size, const configuration &base_settings) |
| Create an ensemble of the given size. More... | |
Create and manage a group of server instances on this local machine (most likely in a single ensemble).
This is exclusively for testing, as running multiple peers on a single machine is a very bad idea in production.
Definition at line 34 of file server_group.hpp.
|
noexcept |
Create an empty server group.
Definition at line 34 of file server_group.cpp.
|
defaultnoexcept |
Move-construct a server group.
| const std::string & zk::server::server_group::get_connection_string | ( | ) |
Get a connection string which can connect to any the servers in the group.
Definition at line 119 of file server_group.cpp.
|
static |
Create an ensemble of the given size.
None of the servers will be started.
| size | The size of the ensemble. This should be an odd number. |
| base_settings | The basic settings to use for every server. |
Definition at line 63 of file server_group.cpp.
|
noexcept |
Move-assign a server group.
Definition at line 39 of file server_group.cpp.
|
inline |
How many servers are in this group?
Definition at line 60 of file server_group.hpp.
| void zk::server::server_group::start_all_servers | ( | const classpath & | packages | ) |
Start all servers in the group.
Note that this does not wait for the servers to be up-and-running. Use a client instance to check for connectability.
Definition at line 124 of file server_group.cpp.