You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Chris Darroch <ch...@pearsoncmg.com> on 2009/03/29 00:20:20 UTC

ZooKeeper Perl module

Hi --

   The http://wiki.apache.org/hadoop/ZooKeeper page includes the
comment that "someday we hope to get Python, Perl, and REST interfaces".
I hope I can help with one item from that list now, at least.  I recently
put together a Perl module named Net::ZooKeeper which is now available
on CPAN:

http://cpan.org/modules/by-category/05_Networking_Devices_IPC/Net/Net-ZooKeeper-0.32.tar.gz
http://search.cpan.org/~cdarroch/Net-ZooKeeper-0.32/ZooKeeper.pm

   Modelled on the DBI module, it provides an interface to ZooKeeper
through the synchronous C API functions, e.g.:

    my $zkh = Net::ZooKeeper->new('localhost:7000');

    my $ret = $zkh->set('/foo', 'baz');

   Net::ZooKeeper currently requires ZooKeeper 3.1.1 (or at least
that version of the C API code) and Perl 5.8.8 or up, including 5.10.x.

   The test suite is reasonably complete, I think, and covers a
fair bit of ground.  I've found it useful for testing the ZooKeeper
C API as well as learning more than I wanted to know about
XS programming.

   I've licensed the module under the Apache license 2.0 so it should
be compatible with ZooKeeper itself if there's interest in including
it under src/contribs.

   For those who ask why Perl 5 and not Rakudo/Ruby/Lua/Python/
[insert cool new dynamic language here], the answer is just that I
needed an old-style Perl module first.  (As a thought experiment,
though, I wonder if one could write a Parrot extension that communicated
directly with ZooKeeper, handled the ping requests internally via
a Parrot scheduler/thread/whatever, and didn't need the C API at all.
You could support any language running on Parrot with that.  Well,
maybe in a few years, anyway.  :-)

   In the meantime, please report any suggestions or bugs to
me -- thanks!

Chris.

-- 
GPG Key ID: 366A375B
GPG Key Fingerprint: 485E 5041 17E1 E2BB C263  E4DE C8E3 FA36 366A 375B

Re: ZooKeeper Perl module

Posted by Patrick Hunt <ph...@apache.org>.
Hey Chris this is really great! Thanks for making it available to the 
community, very cool.

Patrick

Chris Darroch wrote:
> Hi --
> 
>   The http://wiki.apache.org/hadoop/ZooKeeper page includes the
> comment that "someday we hope to get Python, Perl, and REST interfaces".
> I hope I can help with one item from that list now, at least.  I recently
> put together a Perl module named Net::ZooKeeper which is now available
> on CPAN:
> 
> http://cpan.org/modules/by-category/05_Networking_Devices_IPC/Net/Net-ZooKeeper-0.32.tar.gz 
> 
> http://search.cpan.org/~cdarroch/Net-ZooKeeper-0.32/ZooKeeper.pm
> 
>   Modelled on the DBI module, it provides an interface to ZooKeeper
> through the synchronous C API functions, e.g.:
> 
>    my $zkh = Net::ZooKeeper->new('localhost:7000');
> 
>    my $ret = $zkh->set('/foo', 'baz');
> 
>   Net::ZooKeeper currently requires ZooKeeper 3.1.1 (or at least
> that version of the C API code) and Perl 5.8.8 or up, including 5.10.x.
> 
>   The test suite is reasonably complete, I think, and covers a
> fair bit of ground.  I've found it useful for testing the ZooKeeper
> C API as well as learning more than I wanted to know about
> XS programming.
> 
>   I've licensed the module under the Apache license 2.0 so it should
> be compatible with ZooKeeper itself if there's interest in including
> it under src/contribs.
> 
>   For those who ask why Perl 5 and not Rakudo/Ruby/Lua/Python/
> [insert cool new dynamic language here], the answer is just that I
> needed an old-style Perl module first.  (As a thought experiment,
> though, I wonder if one could write a Parrot extension that communicated
> directly with ZooKeeper, handled the ping requests internally via
> a Parrot scheduler/thread/whatever, and didn't need the C API at all.
> You could support any language running on Parrot with that.  Well,
> maybe in a few years, anyway.  :-)
> 
>   In the meantime, please report any suggestions or bugs to
> me -- thanks!
> 
> Chris.
> 

Re: ZooKeeper Perl module

Posted by Patrick Hunt <ph...@apache.org>.
Hey Chris this is really great! Thanks for making it available to the 
community, very cool.

Patrick

Chris Darroch wrote:
> Hi --
> 
>   The http://wiki.apache.org/hadoop/ZooKeeper page includes the
> comment that "someday we hope to get Python, Perl, and REST interfaces".
> I hope I can help with one item from that list now, at least.  I recently
> put together a Perl module named Net::ZooKeeper which is now available
> on CPAN:
> 
> http://cpan.org/modules/by-category/05_Networking_Devices_IPC/Net/Net-ZooKeeper-0.32.tar.gz 
> 
> http://search.cpan.org/~cdarroch/Net-ZooKeeper-0.32/ZooKeeper.pm
> 
>   Modelled on the DBI module, it provides an interface to ZooKeeper
> through the synchronous C API functions, e.g.:
> 
>    my $zkh = Net::ZooKeeper->new('localhost:7000');
> 
>    my $ret = $zkh->set('/foo', 'baz');
> 
>   Net::ZooKeeper currently requires ZooKeeper 3.1.1 (or at least
> that version of the C API code) and Perl 5.8.8 or up, including 5.10.x.
> 
>   The test suite is reasonably complete, I think, and covers a
> fair bit of ground.  I've found it useful for testing the ZooKeeper
> C API as well as learning more than I wanted to know about
> XS programming.
> 
>   I've licensed the module under the Apache license 2.0 so it should
> be compatible with ZooKeeper itself if there's interest in including
> it under src/contribs.
> 
>   For those who ask why Perl 5 and not Rakudo/Ruby/Lua/Python/
> [insert cool new dynamic language here], the answer is just that I
> needed an old-style Perl module first.  (As a thought experiment,
> though, I wonder if one could write a Parrot extension that communicated
> directly with ZooKeeper, handled the ping requests internally via
> a Parrot scheduler/thread/whatever, and didn't need the C API at all.
> You could support any language running on Parrot with that.  Well,
> maybe in a few years, anyway.  :-)
> 
>   In the meantime, please report any suggestions or bugs to
> me -- thanks!
> 
> Chris.
>