NAME
Net::Riak::Bucket - Access and change information about a Riak bucket
VERSION
version 0.07
SYNOPSIS
my $client = Net::Riak->new(...);
my $bucket = $client->bucket('foo');
my $object = $bucket->new_object('foo', {...});
$object->store;
$object->get('foo2');
DESCRIPTION
The Net::Riak::Bucket object allows you to access and change information about a Riak bucket, and provides methods to create or retrieve objects within the bucket.
ATTRIBUTES
- name
-
my $name = $bucket->name;
Get the bucket name
- r
-
my $r_value = $bucket->r;
R value setting for this client (default 2)
- w
-
my $w_value = $bucket->w;
W value setting for this client (default 2)
- dw
-
my $dw_value = $bucket->dw;
DW value setting for this client (default 2)
METHODS
METHODS
new_object
my $obj = $bucket->new_object($key, $data);
Create a new Net::Riak::Object object that will be stored as JSON.
get
my $obj = $bucket->get($key, [$r]);
Retrieve a JSON-encoded object from Riak
n_val
my $n_val = $bucket->n_val;
Get/set the N-value for this bucket, which is the number of replicas that will be written of each object in the bucket. Set this once before you write any data to the bucket, and never change it again, otherwise unpredictable things could happen. This should only be used if you know what you are doing.
allow_multiples
$bucket->allow_multiples(1|0);
If set to True, then writes with conflicting data will be stored and returned to the client. This situation can be detected by calling has_siblings() and get_siblings(). This should only be used if you know what you are doing.
get_keys
my $keys = $bucket->get_keys;
Return the list of keys for a bucket
set_property
$bucket->set_property({n_val => 2});
Set a bucket property. This should only be used if you know what you are doing.
get_property
my $prop = $bucket->get_property('n_val');
Retrieve a bucket property.
set_properties
Set multiple bucket properties in one call. This should only be used if you know what you are doing.
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:
my $properties = $bucket->get_properties({keys=>'true'});
AUTHOR
franck cuny <franck@lumberjaph.net>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by linkfluence.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.