GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::Riak::Bucket(3) User Contributed Perl Documentation Net::Riak::Bucket(3)

Net::Riak::Bucket

version 0.1702

    my $client = Net::Riak->new(...);
    my $bucket = $client->bucket('foo');

    # retrieve an existing object
    my $obj1 = $bucket->get('foo');

    # create/store a new object
    my $obj2 = $bucket->new_object('foo2', {...});
    $object->store;

    $bucket->delete_object($key, 3); # optional w val

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.

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)

new_object
    my $obj = $bucket->new_object($key, $data, @args);
    

Create a new Net::Riak::Object object. Additional Object constructor arguments can be passed after $data. If $data is a reference and no explicit Object content_type is given in @args, the data will be serialised and stored as JSON.

If $key is passed as "undef" then an autogenerated key will be provided by Riak.

get
    my $obj = $bucket->get($key, [$r]);
    

Retrieve an object from Riak.

delete_object
    $bucket->delete_object($key);
    

Delete an object by key

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;
    my $keys = $bucket->get_keys($args);
    

Return an arrayref of the list of keys for a bucket.

Note for the PBC interface: you will need a separate instance of the client (i.e separate connection) if you want to preform actions on the keys whilst streaming them.

Optionally takes a hashref of named parameters. Supported parameters are:

stream => 1
Uses key streaming mode to fetch the list of keys, which may be faster for large keyspaces.
cb => sub { }
A callback subroutine to be called for each key found (passed in as the only parameter). get_keys() returns nothing in callback mode.
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, containing 'props' and 'keys' elements.

Accepts a hashref of parameters. Supported parameters are:

props => 'true'|'false'
Whether to return bucket properties. Defaults to 'true' if no parameters are given.
keys => 'true'|'false'|'stream'
Whether to return bucket keys. If set to 'stream', uses key streaming mode, which may be faster for large keyspaces.
cb => sub { }
A callback subroutine to be called for each key found (passed in as the only parameter). Implies keys => 'stream'. Keys are omitted from the results hashref in callback mode.

franck cuny <franck@lumberjaph.net>, robin edwards <robin.ge@gmail.com>

This software is copyright (c) 2013 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.

2013-03-20 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.