Watcher事件类型(一)
程序员文章站
2022-05-14 22:56:18
...
- 创建父节点触发:NodeCreated
[zk: localhost:2181(CONNECTED) 16] ls /
[zookeeper]
[zk: localhost:2181(CONNECTED) 17] stat /imooc watch
Node does not exist: /imooc
[zk: localhost:2181(CONNECTED) 18] create /imooc
[zk: localhost:2181(CONNECTED) 19] ls /
[zookeeper]
[zk: localhost:2181(CONNECTED) 20] create /imooc 123
WATCHER::
WatchedEvent state:SyncConnected type:NodeCreated path:/imooc
Created /imooc
- 修改父节点数据触发:NodeDataChanged
[zk: localhost:2181(CONNECTED) 22] get /imooc watch
456
cZxid = 0x200000005
ctime = Tue Oct 23 11:10:28 CST 2018
mZxid = 0x200000006
mtime = Tue Oct 23 11:11:45 CST 2018
pZxid = 0x200000005
cversion = 0
dataVersion = 1
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 3
numChildren = 0
[zk: localhost:2181(CONNECTED) 23] set /imooc 789
WATCHER::
WatchedEvent state:SyncConnected type:NodeDataChanged path:/imooc
cZxid = 0x200000005
ctime = Tue Oct 23 11:10:28 CST 2018
mZxid = 0x200000007
mtime = Tue Oct 23 11:12:14 CST 2018
pZxid = 0x200000005
cversion = 0
dataVersion = 2
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 3
numChildren = 0
- 删除父节点触发:NodeDeleted
[zk: localhost:2181(CONNECTED) 24] get /imooc watch
789
cZxid = 0x200000005
ctime = Tue Oct 23 11:10:28 CST 2018
mZxid = 0x200000007
mtime = Tue Oct 23 11:12:14 CST 2018
pZxid = 0x200000005
cversion = 0
dataVersion = 2
aclVersion = 0
ephemeralOwner = 0x0
dataLength = 3
numChildren = 0
[zk: localhost:2181(CONNECTED) 25] delete /imooc
WATCHER::
WatchedEvent state:SyncConnected type:NodeDeleted path:/imooc
推荐阅读
-
学习TypeScript,笔记一:TypeScript的简介与数据类型
-
谈一谈突发性事件营销的借势之力
-
腾讯面试官问我Java中boolean类型占用多少个字节?我说一个,面试官让我回家等通知
-
使用表类型(Table Type-SqlServer)实现百万级别的数据一次性毫秒级别插入
-
python3利用ctypes传入一个字符串类型的列表方法
-
一个小例子解释如何来阻止Jquery事件冒泡
-
Python基础一: 计算机基础,Python相关介绍,变量,常量,注释,基础数据类型(int,str,bool),用户交互input,流程控制语句if
-
关于ajax对象一些常用属性、事件和方法大小写比较常见的问题总结
-
C#编程自学之数据类型和变量一
-
JavaScript基础回顾一(类型、值和变量)