zookeeper学习小结

zookeeper's namespace
[img]http://dl.iteye.com/upload/attachment/0081/8435/6ed8b105-9995-336d-8d5e-4e72c184017c.jpg[/img]

1、znode
Znodes maintain a stat structure that includes version numbers for data changes, ACL changes, and timestamps.( znode节点的数据结构)
The data stored at each znode in a namespace is read and written atomically.(读写的原子性)
ZooKeeper also has the notion of ephemeral nodes,These znodes exists as long as the session that created the znode is active.(znode 的 暂存节点)
ZooKeeper supports the concept of watches. Clients can set a watch on a znodes. (client 端对znode的观察)

znode 数据结构

mtdata1 // znode 名称
cZxid = 0x2 // 创建znode 的 zxid
ctime = Tue Jan 22 23:12:22 CST 2013 // 创建时间
mZxid = 0x3 // 修改znode 的 zxid
mtime = Tue Jan 22 23:13:19 CST 2013 //修改时间
pZxid = 0x2 //
cversion = 0 // znode 子节点版本号
dataVersion = 1 // znode 数据版本号
aclVersion = 0 // acl 版本号
ephemeralOwner = 0x0 // 如果非0,表示拥有此ephemeral节点的session id
dataLength = 7 // znode 数据长度
numChildren = 0 // 子节点个数

zxid = Zookeeper Transaction Id
zxid的存在,对znode 的每次修改连接事务,都有一个唯一的zxid(从小到大递增),zxid的大小可以反映事务的先后顺序,

2、read and write
Read requests are serviced from the local replica of each server database. (读请求访问当前server节点的本地副本)
As part of the agreement protocol all write requests from clients are forwarded to a single server, called the leader.(写请求被agreement protocal 转向到leader进行处理)

3、zookeeper successful used
[url]https://cwiki.apache.org/confluence/display/ZOOKEEPER/PoweredBy[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值