Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/storm/pull/813#discussion_r42815363
  
    --- Diff: storm-core/src/clj/backtype/storm/cluster.clj ---
    @@ -89,68 +107,69 @@
     
          (set-ephemeral-node
            [this path data acls]
    -       (zk/mkdirs zk (parent-path path) acls)
    -       (if (zk/exists zk path false)
    +       (zk/mkdirs zk-writer (parent-path path) acls)
    +       (if (zk/exists zk-writer path false)
              (try-cause
    -           (zk/set-data zk path data) ; should verify that it's ephemeral
    +           (zk/set-data zk-writer path data) ; should verify that it's 
ephemeral
                (catch KeeperException$NoNodeException e
                  (log-warn-error e "Ephemeral node disappeared between 
checking for existing and setting data")
    -             (zk/create-node zk path data :ephemeral acls)))
    -         (zk/create-node zk path data :ephemeral acls)))
    +             (zk/create-node zk-writer path data :ephemeral acls)))
    +         (zk/create-node zk-writer path data :ephemeral acls)))
     
          (create-sequential
            [this path data acls]
    -       (zk/create-node zk path data :sequential acls))
    +       (zk/create-node zk-writer path data :sequential acls))
     
          (set-data
            [this path data acls]
            ;; note: this does not turn off any existing watches
    -       (if (zk/exists zk path false)
    -         (zk/set-data zk path data)
    +       (if (zk/exists zk-writer path false)
    +         (zk/set-data zk-writer path data)
              (do
    -           (zk/mkdirs zk (parent-path path) acls)
    -           (zk/create-node zk path data :persistent acls))))
    +           (zk/mkdirs zk-writer (parent-path path) acls)
    +           (zk/create-node zk-writer path data :persistent acls))))
     
          (delete-node
            [this path]
    -       (zk/delete-node zk path))
    +       (zk/delete-node zk-writer path))
     
          (get-data
            [this path watch?]
    -       (zk/get-data zk path watch?))
    +       (zk/get-data zk-reader path watch?))
     
          (get-data-with-version
            [this path watch?]
    -       (zk/get-data-with-version zk path watch?))
    +       (zk/get-data-with-version zk-reader path watch?))
     
          (get-version 
            [this path watch?]
    -       (zk/get-version zk path watch?))
    +       (zk/get-version zk-reader path watch?))
     
          (get-children
            [this path watch?]
    -       (zk/get-children zk path watch?))
    +       (zk/get-children zk-reader path watch?))
     
          (mkdirs
            [this path acls]
    -       (zk/mkdirs zk path acls))
    +       (zk/mkdirs zk-writer path acls))
     
          (exists-node?
            [this path watch?]
    -       (zk/exists-node? zk path watch?))
    +       (zk/exists-node? zk-reader path watch?))
     
          (close
            [this]
            (reset! active false)
    -       (.close zk))
    +       (.close zk-writer)
    +       (if (is-nimbus?) (.close zk-reader)))
    --- End diff --
    
    nit: If we can replace ```is-nimbus?``` to check object identity between 
zk-writer and zk-reader, it would be more readable.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to