Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3281

Add a new CLI:watch

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.6.0
    • Fix Version/s: None
    • Component/s: scripts

      Description

      Terminal1:t1;
      Terminal2:t2;

      PART1:
      -------------[-d] test for data change-----------------------
      [t1]:
      watch -d /testwatch
      [t2]:
      set /testwatch mydata
      [t1]: result:
      WatchedEvent state:SyncConnected
      type:NodeDataChanged
      path:/testwatch
      new data:mydata
      ----------------------------------------------------------------
      [t1]:
      watch -d /testwatch
      [t2]:
      delete /testwatch
      [t1] result:
      WatchedEvent state:SyncConnected
      type:NodeDeleted
      path:/testwatch

      PART2:
      -------------[-c] test for child change-----------------------
      [t1]:
      watch -c /testwatch
      [t2]
      create /testwatch/child_1 mydata
      [t1] reslut:
      WatchedEvent state:SyncConnected
      type:NodeChildrenChanged
      path:/testwatch
      new child list:[child_1]
      ----------------------------------------------------------------
      [t1]:
      watch -c /testwatch
      [t2]:
      delete /testwatch/child_1
      [t1]:
      WatchedEvent state:SyncConnected
      type:NodeChildrenChanged
      path:/testwatch
      new child list:[]

      PART3:
      ---------------[-e]test for exist watch---------------------
      [t2]:
      delete /testwatch
      [t1]:
      watch -e /testwatch
      [t2]:
      create /testwatch mydata
      [t1] result:
      WatchedEvent state:SyncConnected
      type:NodeCreated
      path:/testwatch
      ----------------------------------------------------------------
      [t1]:
      watch -e /testwatch
      [t2]:
      delete /testwatch
      WatchedEvent state:SyncConnected
      type:NodeDeleted
      path:/testwatch
      ----------------------------------------------------------------
      [t1]:
      watch -e /testwatch
      [t2]:
      set /testwatch mydata666666666
      [t1]:
      WatchedEvent state:SyncConnected
      type:NodeDataChanged
      path:/testwatch

      ----------------------------------------------------------------
      a test for watching a non-existent key
      [t1]:
      watch -d /non-existent_key
      Node does not exist: /non-existent_key
      watch -c /non-existent_key
      Node does not exist: /non-existent_key
      watch -e /non-existent_key
      [t2]:
      create /non-existent_key mydata
      [t1]:
      WatchedEvent state:SyncConnected
      type:NodeCreated
      path:/non-existent_key
      ----------------------------------------------------------------
      the test for other watchedEvent state: e.g. Disconnected
      [t1]:
      watch -c /testwatch
      #kill the zk server
      WatchedEvent state:Disconnected
      type:None
      path:null

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                maoling maoling
                Reporter:
                maoling maoling
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m