zookeeper学习小结
zookeeper's namespace
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 // 子节点个数