[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12695668#action_12695668
 ] 

Chris Darroch commented on ZOOKEEPER-364:
-----------------------------------------

Just FYI on the Perl side of things, CPAN is just a distribution channel -- the 
Perl module could easily be donated to the ASF and shipped as part of 
ZooKeeper, if there was interest.  Since Perl users tend to look at CPAN first, 
though, I wanted to put it there as well.  Things like mod_perl are generally 
available from both apache.org and cpan.org but maintained by the ASF.

Since most Linux/Unix folks will have Perl installed by default -- and 
Net::ZooKeeper really is only going to be simple to build on Linux/Unix anyway, 
because of the pthread requirement in the C API -- it's not hard to build a 
command-line interface; in fact, pretty simple.  Ephemerals, sequences, 
watches, and ACLs all are supported by the module.

That said, personally, I think lots of people will want a Python binding as 
well -- I just happened to need a Perl one first.  I caution that building it 
took more of my time than I expected; getting things like watches to work took 
a number of tries.  Because the multi-threaded C API runs two private threads 
in the background to handle IO (especially pings), you can't allow them to just 
arbitrarily make callbacks upon a watch event notification into Perl code -- 
that could fry the interpreter's state over in the "main" thread.  And you want 
to be sure that if the user decides to abandon some higher-level object that 
represents the watch (e.g., lets it go out of scope before the event 
notification occurs) then when the watch event does come in you haven't thrown 
away the private structure the callback is expecting to update.

There may be a niftier way to handle this with Python since Python supports 
threading better than Perl 5.x, by using the single-threaded stub adapter and 
doing all the calls to zookeeper_interest(), zookeeper_process(), etc. from the 
Python module, i.e., implementing the event loops in Python threads spawned by 
the module.  Still, it's not a cakewalk, I suspect.

(I was kidding about the Parrot implementation, but I'm also intrigued by the 
possibility that 5 years from now these sorts of conversations might be moot, 
if one could write a module in Parrot code that implemented the event loop and 
was then usable with Parrot-compiled versions of Python, Ruby, Perl, etc.  When 
time permits (ha!) I've been meaning to pull down Parrot 1.0 and peek at its 
concurrency and extension mechanisms.)

> command line interface for zookeeper.
> -------------------------------------
>
>                 Key: ZOOKEEPER-364
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-364
>             Project: Zookeeper
>          Issue Type: New Feature
>    Affects Versions: 3.0.0, 3.0.1, 3.1.0, 3.1.1
>            Reporter: Mahadev konar
>             Fix For: 3.2.0
>
>
> currently we have a shell based interface for zookeeper (which again isnt 
> well published). we should have a well published cli based interface for 
> zookeeper.

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

Reply via email to