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(3) User Contributed Perl Documentation Net::Riak(3)

Net::Riak - Interface to Riak

version 0.1702

    # REST interface
    my $client = Net::Riak->new(
        host => 'http://10.0.0.40:8098',
        ua_timeout => 900,
    );

    # Or PBC interface.
    my $client = Net::Riak->new(
        transport => 'PBC',
        host => '10.0.0.40',
        port => 8080
    );

    my $bucket = $client->bucket('blog');
    my $obj    = $bucket->new_object('new_post', {title => 'foo', content => 'bar'});
    $obj->store;

    $obj = $bucket->get('new_post');
    say "title for ".$obj->key." is ".$obj->data->{title};

    # Indexing and searching (REST interface)
    $client->setup_indexing("bucket_name");
    ...adding documents to riak...
    my $response = $client->search(
        index => 'bucket_name',
        q     => 'field:value'
    );

    # Secondary index setup (REST interface)
    my $obj3 = $bucket->new_object('foo3', {...});
    $obj3->add_index('myindex_bin','myvalue' );
    $obj3->add_index('number_int', 1001);
    $obj3->store;

    # Get all keys for a specific index/value pair
    my @keys = $client->index('mybucket', 'myindex_bin', 'myvalue' );

    # Get all keys for a range of index value pairs
    my @keys = $client->index('mybucket', 'number_int', 500, 1500);

    # Removing a secondary index (REST interface)
    my $new_obj = $bucket->get('foo3');
    $new_obj->remove_index('number_int', 1001);
    $new_obj->store;

host
REST: The URL of the node

PBC: The hostname of the node

default 'http://127.0.0.1:8098'

Note that providing multiple hosts is now deprecated.

port
Port of the PBC interface.
transport
Used to select the PB protocol by passing in 'PBC'
prefix
Interface prefix (default 'riak')
mapred_prefix
MapReduce prefix (default 'mapred')
r
R value setting for this client (default 2)
w
W value setting for this client (default 2)
dw
DW value setting for this client (default 2)
client_id
client_id for this client
ua_timeout (REST only)
timeout for LWP::UserAgent in seconds, defaults to 3.
disable_return_body (REST only)
Disable returning of object content in response in a store operation.

If set to true and the object has siblings these will not be available without an additional fetch.

This will become the default behaviour in 0.17

    my $bucket = $client->bucket($name);

Get the bucket by the specified name. Since buckets always exist, this will always return a Net::Riak::Bucket

    if (!$client->is_alive) {
        ...
    }

Check if the Riak server for this client is alive

List all buckets, requires Riak 0.14+ or PBC connection.

    my $map_reduce = $client->add('bucket_name', 'key');

Start assembling a Map/Reduce operation

    my $map_reduce = $client->link();

Start assembling a Map/Reduce operation

    my $map_reduce = $client->add('bucket_name', 'key')->map("function ...");

Start assembling a Map/Reduce operation

    my $map_reduce = $client->add(..)->map(..)->reduce("function ...");

Start assembling a Map/Reduce operation

    $client->server_info->{server_version};

    say Dumper $client->stats;

    $client->search( index => 'bucket_name', q => 'field:value' );

Makes a query to the index (see Net::Riak::Search for more details on parameters)

    $client->setup_indexing('bucket_name');

Define precommit hook in order to enable indexing documents written into the given bucket

Net::Riak::MapReduce

Net::Riak::Object

Net::Riak::Bucket

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.