You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Henry Robinson (JIRA)" <ji...@apache.org> on 2009/06/05 14:10:07 UTC

[jira] Created: (ZOOKEEPER-432) Various improvements to zkpython bindings

Various improvements to zkpython bindings
-----------------------------------------

                 Key: ZOOKEEPER-432
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
             Project: Zookeeper
          Issue Type: Improvement
          Components: contrib-bindings
            Reporter: Henry Robinson
            Assignee: Henry Robinson


What's new, from the README for this new version:

----------------------------------
More test coverage. 

Better reference counting, fixing at least two serious bugs.

Out-of-range zhandles are now checked, fixing a potential security hole.

Docstrings! Editing and cleanup required, but most of the text is there.

zookeeper.set_watcher is now implemented correctly.

zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.

get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 

Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Henry Robinson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Robinson updated ZOOKEEPER-432:
-------------------------------------

    Attachment: ZOOKEEPER-432.patch

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>         Attachments: ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Henry Robinson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Robinson updated ZOOKEEPER-432:
-------------------------------------

    Status: Patch Available  (was: Open)

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719809#action_12719809 ] 

Mahadev konar commented on ZOOKEEPER-432:
-----------------------------------------

forgot to mention that the line number is without applying the patch ... 

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12720613#action_12720613 ] 

Hudson commented on ZOOKEEPER-432:
----------------------------------

Integrated in ZooKeeper-trunk #349 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/349/])
    

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719754#action_12719754 ] 

Mahadev konar commented on ZOOKEEPER-432:
-----------------------------------------

the patch looks goods. a few questions/comments:

- the patch has chmod_tests.sh that sets the svn executable. Do we realyl need that? A committer can just set the files that you want to be executable while commiting... no?
- also, just checking to confirm that the patch does not implement the other zoo_w* apis with local watches and context objects right?

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719830#action_12719830 ] 

Mahadev konar commented on ZOOKEEPER-432:
-----------------------------------------

agreed. .. ill commit the patch without chmod_tests.patch ... 

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Henry Robinson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719816#action_12719816 ] 

Henry Robinson commented on ZOOKEEPER-432:
------------------------------------------

Ah, sorry, I see what you mean.

There's no explicit ctx object in the Python API. Instead, callables can be created at run-time which encapsulate local state.

For example:

def internal_watcher(handle, type, state, path, ctxt):
    pass

myctxt = create_context( )
zoo_exists(zhandle, "/foo", lambda handle, type, state, path: internal_watcher(handle, type, state, path,myctxt))

Because Python has closures of a sort, plus easy run-time creation of callable objects, it seems more 'Pythonic' to wrap context up this way rather than as a separate explicit object. In the Python C bindings, this is all part of the PyObject that is deserialised from the method call.



> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Henry Robinson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Robinson updated ZOOKEEPER-432:
-------------------------------------

    Attachment: ZOOKEEPER-432.patch

Forgot to bump minor version number.

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719807#action_12719807 ] 

Mahadev konar commented on ZOOKEEPER-432:
-----------------------------------------

henry, just to clear what I meant

{code}
  if (!PyArg_ParseTuple(args, "isO", &zkhid, &path, &watcherfn))
{code}

line 567 in zookeeper.c in zkpython does not deserialize the local watcherctx. So does the python api allow you do pass a ctx object with a local watcherfn? 


> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-432:
------------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

I just committed this. thanks henry!

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mahadev konar updated ZOOKEEPER-432:
------------------------------------

    Fix Version/s: 3.2.0

marking it for 3.2... 

> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-432) Various improvements to zkpython bindings

Posted by "Henry Robinson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719802#action_12719802 ] 

Henry Robinson commented on ZOOKEEPER-432:
------------------------------------------

chmod_tests.sh was a request from ZOOKEEPER-421, although I thought as you did that it could be handled by the committers.

Not sure I totally understand your second question - zkpython doesn't implement the API calls which take a boolean watch parameter - as far as my understanding goes, they can be emulated exactly with the zoo_w* calls. The Python module actually uses zoo_w* functions internally.

However all watches are allocated and stored locally, and a single dispatch point is used to multiplex events to watchers via the context objects, which contain Python callables. 



> Various improvements to zkpython bindings
> -----------------------------------------
>
>                 Key: ZOOKEEPER-432
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-432
>             Project: Zookeeper
>          Issue Type: Improvement
>          Components: contrib-bindings
>            Reporter: Henry Robinson
>            Assignee: Henry Robinson
>             Fix For: 3.2.0
>
>         Attachments: ZOOKEEPER-432.patch, ZOOKEEPER-432.patch
>
>
> What's new, from the README for this new version:
> ----------------------------------
> More test coverage. 
> Better reference counting, fixing at least two serious bugs.
> Out-of-range zhandles are now checked, fixing a potential security hole.
> Docstrings! Editing and cleanup required, but most of the text is there.
> zookeeper.set_watcher is now implemented correctly.
> zookeeper.client_id is now implemented correctly. zookeeper.init now respects the client_id parameter.
> get_context and set_context have been removed from the API. The context mechanism is used by PyZK to store the callables that are dispatched by C-side watchers. Messing with this from Python-side causes bugs very quickly. You should wrap all desired context up in a callable and then use zookeeper.set_watcher to attach it to the global watcher. 
> Many methods now have optional parameters (usually if you can specify a watch, it's optional). The only time where genuinely optional parameters are still mandatory is when a required parameters comes after it. Currently we still respect the ZK C client parameter ordering. For example, you can simply connect with zookeeper.init("host:port") and ignore the other three parameters.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.