zookeeper-cpp
ZooKeeper Client for C++
|
The package registry tracks configuration of classpaths and JARs needed to run various ZooKeeper versions. More...
#include <zk/server/package_registry.hpp>
Classes | |
struct | registration_info |
Public Types | |
using | size_type = std::size_t |
using | registration = std::shared_ptr< registration_info > |
Public Member Functions | |
registration | register_classpath_server (std::string version, std::string classpath) |
Register a server that can be created via the specified Java classpath. More... | |
bool | unregister_server (registration reg) |
Attempt to unregister the server associated with the provided registration. More... | |
bool | unregister_server (const registration_info ®) |
size_type | size () const |
How many registrations have been registered? More... | |
bool | empty () const |
Is this registry empty? More... | |
optional< std::string > | find_newest_classpath () const |
Get the classpath for running the newest registered server version. More... | |
The package registry tracks configuration of classpaths and JARs needed to run various ZooKeeper versions.
package_registry
is being destroyed. Definition at line 25 of file package_registry.hpp.
|
inline |
Is this registry empty?
Definition at line 61 of file package_registry.hpp.
optional< std::string > zk::server::package_registry::find_newest_classpath | ( | ) | const |
Get the classpath for running the newest registered server version.
std::string
as a classpath is terrible. It should be replaced by a dedicated run_settings
class. Definition at line 66 of file package_registry.cpp.
package_registry::registration zk::server::package_registry::register_classpath_server | ( | std::string | version, |
std::string | classpath | ||
) |
Register a server that can be created via the specified Java classpath.
version | A version string used to look up the server when creating them. While this can be a lie, it should not be. |
classpath | The Java classpath used to run the server. This will be the cp argument to Java. |
unregister_server
. std::invalid_argument | if version is already registered. |
Definition at line 35 of file package_registry.cpp.
package_registry::size_type zk::server::package_registry::size | ( | ) | const |
How many registrations have been registered?
Definition at line 60 of file package_registry.cpp.
bool zk::server::package_registry::unregister_server | ( | registration | reg | ) |
Attempt to unregister the server associated with the provided registration.
Unregistering will prevent future servers from being created with the particular setup, but will not teardown servers which might be running with it.
true
if this call removed anything; false
if otherwise. Definition at line 52 of file package_registry.cpp.