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

Add python example script

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      A skeleton script that shows how to setup znode watches and how to react to events using the Python client libraries.

      Description

      When adding some zookeeper-based functionality to a python script I had to figure everything out without guidance, which while doable, would have been a lot easier with an example. I extracted a skeleton program structure out with hopes its useful to others (maybe add as an example in the source or wiki?).

      This script does an aget() and sets a watch, and hopefully illustrates what's going on, and where to plug in your application code that gets run when the znode changes.

      There are probably some bugs, which if we fix now and provide a well-reviewed example hopefully others will not run into the same mistakes.

        Attachments

        1. ZOOKEEPER-765.patch
          7 kB
          Andrei Savu
        2. ZOOKEEPER-765.patch
          7 kB
          Andrei Savu
        3. zk.py
          4 kB
          Travis Crawford

        Issue Links

          Activity

          $i18n.getText('security.level.explanation', $currentSelection) Viewable by All Users
          Cancel

            People

            • Assignee:
              savu.andrei Andrei Savu Assign to me
              Reporter:
              traviscrawford Travis Crawford

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment