RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions
Datacratic::ZookeeperConfigurationService Struct Reference

#include <zookeeper_configuration_service.h>

Inheritance diagram for Datacratic::ZookeeperConfigurationService:
Datacratic::ConfigurationService

List of all members.

Public Member Functions

 ZookeeperConfigurationService (const std::string &host, const std::string &prefix, int timeout=5)
void init (const std::string &host, const std::string &prefix, int timeout=5)
virtual Json::Value getJson (const std::string &value, Watch watch=Watch())
virtual void set (const std::string &key, const Json::Value &value)
virtual std::string setUnique (const std::string &key, const Json::Value &value)
virtual std::vector< std::string > getChildren (const std::string &key, Watch watch=Watch())
virtual bool forEachEntry (const OnEntry &onEntry, const std::string &startPrefix="") const
virtual void removePath (const std::string &path)

Detailed Description

Configuration service built on top of Zookeeper.

Definition at line 26 of file zookeeper_configuration_service.h.


Member Function Documentation

bool Datacratic::ZookeeperConfigurationService::forEachEntry ( const OnEntry onEntry,
const std::string &  startPrefix = "" 
) const [virtual]

Iterate over all entries in the configuration database recursively, calling the given callback. Note that no watches can be set using this function.

Implements Datacratic::ConfigurationService.

Definition at line 206 of file zookeeper_configuration_service.cc.

std::vector< std::string > Datacratic::ZookeeperConfigurationService::getChildren ( const std::string &  key,
Watch  watch = Watch() 
) [virtual]

Return the set of children for the given node. If the node does not exist, the watch will be set for the creation of the node itself.

Implements Datacratic::ConfigurationService.

Definition at line 194 of file zookeeper_configuration_service.cc.

Json::Value Datacratic::ZookeeperConfigurationService::getJson ( const std::string &  key,
Watch  watch = Watch() 
) [virtual]

Get the JSON value of a node in a synchronous manner.

Implements Datacratic::ConfigurationService.

Definition at line 147 of file zookeeper_configuration_service.cc.

void Datacratic::ZookeeperConfigurationService::removePath ( const std::string &  path) [virtual]

Recursively remove everything below this path.

Implements Datacratic::ConfigurationService.

Definition at line 254 of file zookeeper_configuration_service.cc.

void Datacratic::ZookeeperConfigurationService::set ( const std::string &  key,
const Json::Value value 
) [virtual]

Set the JSON value of a node. If the linkedKey is set, then the lifecycle of the value is linked to the lifecycle of the linked key, and if the linked key is deleted the given value will be deleted also.

Implements Datacratic::ConfigurationService.

Definition at line 164 of file zookeeper_configuration_service.cc.

std::string Datacratic::ZookeeperConfigurationService::setUnique ( const std::string &  key,
const Json::Value value 
) [virtual]

Set the value of a node, ensuring that it's created by adding a suffix if necessary. Returns the actual place under which it was added.

Implements Datacratic::ConfigurationService.

Definition at line 179 of file zookeeper_configuration_service.cc.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator