Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tutorial or example for zookeeper C binding [closed]

I am trying to create an application that uses the zookeeper C/C++ api. I would like to get a few examples on how they are used. I perused through the official documentation, but a lot of details are missing, many sections are listed as TODOs. I looked through the code examples, but there are hardly any comments, which makes it difficult to understand what's going on. Could anybody help with some documentation specifically for creating C bindings?

FYI: I checked the usual channels, google, official documentation etc.

like image 785
pjay Avatar asked Jul 20 '12 05:07

pjay


People also ask

What is Pzxid in ZooKeeper?

ZooKeeper Stat Structure pzxid The zxid of the change that last modified children of this znode. ctime The time in milliseconds from epoch when this znode was created. mtime The time in milliseconds from epoch when this znode was last modified. version The number of changes to the data of this znode.

What is Znodes in ZooKeeper?

In the ZooKeeper documentatin, znodes refer to the data nodes. Servers to refer to machines that make up the ZooKeeper service; quorum peers refer to the servers that make up an ensemble; client refers to any host or process which uses a ZooKeeper service. Znodes are the main enitity that a programmer access.

Which of the four letter word commands will show you the status of a ZooKeeper server?

Each command is composed of four letters. You issue the commands to ZooKeeper via telnet or nc, at the client port. Three of the more interesting commands: "stat" gives some general information about the server and connected clients, while "srvr" and "cons" give extended details on server and connections respectively.

What is tickTime in ZooKeeper?

tickTime : the basic time unit in milliseconds used by ZooKeeper. It is used to do heartbeats and the minimum session timeout will be twice the tickTime. dataDir : the location to store the in-memory database snapshots and, unless specified otherwise, the transaction log of updates to the database.


1 Answers

Zookeeper client C binding are pretty close to Java bindings. So you can use http://zookeeper.apache.org/doc/r3.3.4/api/index.html to familiarize with concepts. Also this page http://zookeeper.apache.org/doc/r3.3.4/zookeeperProgrammers.html contains general description with several examples in C.

But I am afraid there aren't much C bindings specific docs out there. I was in the same situation some time ago myself. I was forced to read source code to answer all my questions.

like image 56
Alexandr Priymak Avatar answered Oct 08 '22 15:10

Alexandr Priymak