码迷,mamicode.com
首页 > 其他好文 > 详细

zookeeper之CreateMode

时间:2018-07-25 22:44:43      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:path   delete   and   nic   persist   作用   create   append   The   

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

标签:path   delete   and   nic   persist   作用   create   append   The   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!