zookeeper֮CreateMode

匿名 (未验证) 提交于 2019-12-02 22:56:40

CreateMode 该类的作用是如何在zookeeper中创建节点!

   /**      * The znode will not be automatically deleted upon client‘s disconnect.      */     PERSISTENT (0, false, false), 

  客户端断开连接的时候,不会自动删除节点

    /**     * 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) 

  客户端断开连接的时候,不会自动删除节点,并且会将节点名拼接一个自增值,例如:创建节点时path输入的是test,当客户端退出时path将变成test0000000001,该值(0000000001)会自动增长!

 /**      * The znode will be deleted upon the client‘s disconnect.      */     EPHEMERAL (1, true, 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); 

  客户端断开连接的时候,将会自定删除几点,并且将节点名拼接一个自增值(同上)

 

zookeeper֮CreateMode

原文:https://www.cnblogs.com/shiguotao-com/p/9368672.html

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