hadoop-zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Darroch <chr...@pearsoncmg.com>
Subject ZooKeeper Perl module
Date Sat, 28 Mar 2009 23:20:20 GMT
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

Mime
View raw message