فهرست منبع

ZOOKEEPER-4406: fix the znode type for Barrier implementation in the zookeeperTutorial.md

With EPHEMERAL_SEQUENTIAL,the generated node name will be added with the sequence number, and the delete() will report error that it cannot be found
EPHEMERAL_SEQUENTIAL产生的节点名会加上顺序编号,删除会报找不到

Author: yuMoyu <2394988933@qq.com>

Reviewers: maoling <maoling@apache.org>

Closes #1738 from yuMoyu/patch-1
yuMoyu 3 سال پیش
والد
کامیت
e5dd8a57cd
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      zookeeper-docs/src/main/resources/markdown/zookeeperTutorial.md

+ 2 - 2
zookeeper-docs/src/main/resources/markdown/zookeeperTutorial.md

@@ -156,7 +156,7 @@ a boolean flag that enables the process to set a watch. In the code the flag is
 
 
     boolean enter() throws KeeperException, InterruptedException{
     boolean enter() throws KeeperException, InterruptedException{
         zk.create(root + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE,
         zk.create(root + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE,
-                CreateMode.EPHEMERAL_SEQUENTIAL);
+                CreateMode.EPHEMERAL);
         while (true) {
         while (true) {
             synchronized (mutex) {
             synchronized (mutex) {
                 List<String> list = zk.getChildren(root, true);
                 List<String> list = zk.getChildren(root, true);
@@ -463,7 +463,7 @@ Start a barrier with 2 participants (start as many times as many participants yo
 
 
             boolean enter() throws KeeperException, InterruptedException{
             boolean enter() throws KeeperException, InterruptedException{
                 zk.create(root + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE,
                 zk.create(root + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE,
-                        CreateMode.EPHEMERAL_SEQUENTIAL);
+                        CreateMode.EPHEMERAL);
                 while (true) {
                 while (true) {
                     synchronized (mutex) {
                     synchronized (mutex) {
                         List<String> list = zk.getChildren(root, true);
                         List<String> list = zk.getChildren(root, true);