From d4393e5b7aaa35ebd11d729da923ce8bea2137cf Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Wed, 8 Sep 2010 09:43:26 +0100 Subject: update Bucket pod with stream changes (and misc tweaks) --- lib/Net/Riak/Bucket.pm | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'lib/Net/Riak/Bucket.pm') diff --git a/lib/Net/Riak/Bucket.pm b/lib/Net/Riak/Bucket.pm index 9720e86..b8a0a36 100644 --- a/lib/Net/Riak/Bucket.pm +++ b/lib/Net/Riak/Bucket.pm @@ -136,9 +136,13 @@ sub new_object { my $client = Net::Riak->new(...); my $bucket = $client->bucket('foo'); - my $object = $bucket->new_object('foo', {...}); + + # retrieve an existing object + my $obj1 = $bucket->get('foo'); + + # create/store a new object + my $obj2 = $bucket->new_object('foo2', {...}); $object->store; - $object->get('foo2'); =head1 DESCRIPTION @@ -203,8 +207,17 @@ If set to True, then writes with conflicting data will be stored and returned to =method get_keys my $keys = $bucket->get_keys; + my $keys = $bucket->get_keys($args); + +Return an arrayref of the list of keys for a bucket. Optionally takes a hashref of named parameters. Supported parameters are: + +=over 4 -Return an arrayref of the list of keys for a bucket. +=item stream => 1 + +Use 'keys=stream' streaming mode to fetch the list of keys, which may be faster for large keyspaces. + +=back =method set_property @@ -224,7 +237,12 @@ Set multiple bucket properties in one call. This should only be used if you know =method get_properties -Retrieve an associative array of all bucket properties. By default, 'props' is set to true and 'keys' to false. You can change this default: +Retrieve an associative array of all bucket properties, containing 'props' and 'keys' elements. + +Accepts a hashref of parameters, containing flags for 'props' and 'keys'. By default, 'props' is set to true and 'keys' to false. You can change this default: + + my $properties = $bucket->get_properties({props=>'false',keys=>'true'}); - my $properties = $bucket->get_properties({keys=>'true'}); +The 'props' parameter may be 'true' or 'false'. The 'keys' parameter may be 'false' or 'true' or 'stream', to get the keys back in streaming mode (which may be faster for large keyspaces). +=cut -- cgit 1.4.1