zk的CreateNode

流过昼夜 提交于 2019-11-30 12:25:12
节点类型
/**
 * The znode will not be automatically deleted upon client's disconnect.
 * 客户端关闭后znode才会删除
 */
PERSISTENT(0, false, false, false, false),
/**
 * znode的名字添加一个单调递增的数字
 * The znode will not be automatically deleted upon client's disconnect,
 * and its name will be appended with a monotonically increasing number.
 */
PERSISTENT_SEQUENTIAL(2, false, true, false, false),
/**
 * The znode will be deleted upon the client's disconnect.
 */
EPHEMERAL(1, true, false, false, false),
/**
 * The znode will be deleted upon the client's disconnect, and its name
 * will be appended with a monotonically increasing number.
 */
EPHEMERAL_SEQUENTIAL(3, true, true, false, false),

思考:
SEQUENTIAL是如何实现的?是否能够连续递增

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!