From 6910b7be19c747c5b8044a58c1877272530957db Mon Sep 17 00:00:00 2001 From: Robin Edwards Date: Wed, 20 Mar 2013 12:15:29 +0000 Subject: Clean up ws --- lib/Net/Riak/Role/PBC.pm | 2 +- lib/Net/Riak/Role/PBC/Bucket.pm | 9 +- lib/Net/Riak/Role/PBC/Link.pm | 12 +- lib/Net/Riak/Role/PBC/MapReduce.pm | 5 +- lib/Net/Riak/Role/PBC/Object.pm | 10 +- lib/Net/Riak/Search.pm | 9 +- lib/Net/Riak/Transport/PBC.pm | 7 +- lib/Net/Riak/Transport/PBC/Transport.pm | 212 ++++++++++++++++---------------- t/03_delete_object.t | 2 +- t/05_object_siblings.t | 8 +- t/11_get_keys.t | 6 +- t/lib/Test/Riak.pm | 6 +- 12 files changed, 137 insertions(+), 151 deletions(-) diff --git a/lib/Net/Riak/Role/PBC.pm b/lib/Net/Riak/Role/PBC.pm index 775976e..7e6aee3 100644 --- a/lib/Net/Riak/Role/PBC.pm +++ b/lib/Net/Riak/Role/PBC.pm @@ -82,4 +82,4 @@ sub server_info { sub stats { die "->stats is only avaliable through the REST interface" } -1; +1; diff --git a/lib/Net/Riak/Role/PBC/Bucket.pm b/lib/Net/Riak/Role/PBC/Bucket.pm index aa7d7fa..6cd4240 100644 --- a/lib/Net/Riak/Role/PBC/Bucket.pm +++ b/lib/Net/Riak/Role/PBC/Bucket.pm @@ -1,7 +1,5 @@ package Net::Riak::Role::PBC::Bucket; - use Moose::Role; -use Data::Dumper; sub get_properties { my ( $self, $name, $params ) = @_; @@ -29,7 +27,7 @@ sub get_keys { if ( defined $_[0]->keys ) { if ($params->{cb}) { $params->{cb}->($_) for @{ $_[0]->keys }; - } + } else { push @$keys, @{ $_[0]->keys }; } @@ -37,10 +35,7 @@ sub get_keys { } ); - return $params->{cb} ? undef : $keys; + return $params->{cb} ? undef : $keys; } - - 1; - diff --git a/lib/Net/Riak/Role/PBC/Link.pm b/lib/Net/Riak/Role/PBC/Link.pm index 5e6a336..7cba54a 100644 --- a/lib/Net/Riak/Role/PBC/Link.pm +++ b/lib/Net/Riak/Role/PBC/Link.pm @@ -23,12 +23,12 @@ sub _links_for_message { my ($self, $object) = @_; return [ - map { { - tag => $_->tag, - key => $_->key, - bucket => $_->bucket->name - } - } $object->all_links + map { { + tag => $_->tag, + key => $_->key, + bucket => $_->bucket->name + } + } $object->all_links ] } diff --git a/lib/Net/Riak/Role/PBC/MapReduce.pm b/lib/Net/Riak/Role/PBC/MapReduce.pm index afeabe8..00e7de1 100644 --- a/lib/Net/Riak/Role/PBC/MapReduce.pm +++ b/lib/Net/Riak/Role/PBC/MapReduce.pm @@ -2,7 +2,6 @@ package Net::Riak::Role::PBC::MapReduce; use Moose::Role; use JSON; use List::Util 'sum'; -use Data::Dump 'pp'; sub execute_job { my ($self, $job, $timeout, $returned_phases) = @_; @@ -16,8 +15,8 @@ sub execute_job { my $resp = $self->send_message( MapRedReq => { request => $job_request, content_type => 'application/json' - }, sub { push @$results, $self->decode_phase(shift) }) - or + }, sub { push @$results, $self->decode_phase(shift) }) + or die "MapReduce query failed!"; diff --git a/lib/Net/Riak/Role/PBC/Object.pm b/lib/Net/Riak/Role/PBC/Object.pm index 280956c..0f960d2 100644 --- a/lib/Net/Riak/Role/PBC/Object.pm +++ b/lib/Net/Riak/Role/PBC/Object.pm @@ -1,8 +1,6 @@ package Net::Riak::Role::PBC::Object; - use JSON; use Moose::Role; -use Data::Dumper; use List::Util 'first'; sub store_object { @@ -10,7 +8,7 @@ sub store_object { die "Storing object without a key is not supported in the PBC interface" unless $object->key; - my $value = (ref $object->data && $object->content_type eq 'application/json') + my $value = (ref $object->data && $object->content_type eq 'application/json') ? JSON::encode_json($object->data) : $object->data; my $content = { @@ -94,7 +92,7 @@ sub populate_object { $self->_populate_metas($object, $content->usermeta); } - my $data = ($object->content_type eq 'application/json') + my $data = ($object->content_type eq 'application/json') ? JSON::decode_json($content->value) : $content->value; $object->exists(1); @@ -117,7 +115,7 @@ sub retrieve_sibling { # hack for loading 1 sibling if ($params->{vtag}) { - $resp->{content} = [ + $resp->{content} = [ first { $_->vtag eq $params->{vtag} } @{$resp->content} @@ -133,7 +131,7 @@ sub retrieve_sibling { $sibling->_jsonize($object->_jsonize); $self->populate_object($sibling, $resp); - + $sibling; } diff --git a/lib/Net/Riak/Search.pm b/lib/Net/Riak/Search.pm index 368b7e7..c31516f 100644 --- a/lib/Net/Riak/Search.pm +++ b/lib/Net/Riak/Search.pm @@ -1,5 +1,4 @@ -package -Net::Riak::Search; +package Net::Riak::Search; use Moose; #ABSTRACT: Search interface @@ -37,9 +36,9 @@ sub setup_indexing { my $obj3 = $bucket->new_object('foo3', {...}); $obj3->add_index('index', 'first'); $obj3->store; - + my @keys = $client->index('bucket', 'myindex_bin', 'first_value' [, 'last_value'] ); - + =head1 DESCRIPTION L allows you to enable indexing documents for a given bucket and querying/searching the index. @@ -98,7 +97,7 @@ remove secondary index from object =item index Find keys via secondary index. - + =back diff --git a/lib/Net/Riak/Transport/PBC.pm b/lib/Net/Riak/Transport/PBC.pm index e495663..a0951d6 100644 --- a/lib/Net/Riak/Transport/PBC.pm +++ b/lib/Net/Riak/Transport/PBC.pm @@ -1,9 +1,4 @@ package Net::Riak::Transport::PBC; - use Moose::Role; - -with qw/ - Net::Riak::Role::PBC - /; - +with qw/Net::Riak::Role::PBC/; 1; diff --git a/lib/Net/Riak/Transport/PBC/Transport.pm b/lib/Net/Riak/Transport/PBC/Transport.pm index 7993f66..32242a4 100644 --- a/lib/Net/Riak/Transport/PBC/Transport.pm +++ b/lib/Net/Riak/Transport/PBC/Transport.pm @@ -3,18 +3,18 @@ package Net::Riak::Transport::PBC::Transport; ## ## This file was generated by Google::ProtocolBuffers (0.08) ## on Mon Dec 13 11:30:34 2010 -## +## use strict; use warnings; use Google::ProtocolBuffers; -{ +{ unless (RpbSetClientIdReq->can('_pb_fields_list')) { Google::ProtocolBuffers->create_message( 'RpbSetClientIdReq', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'client_id', 1, undef ], @@ -28,13 +28,13 @@ use Google::ProtocolBuffers; 'RpbSetBucketReq', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'bucket', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - 'RpbBucketProps', + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + 'RpbBucketProps', 'props', 2, undef ], @@ -48,38 +48,38 @@ use Google::ProtocolBuffers; 'RpbPutReq', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'bucket', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'key', 2, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'vclock', 3, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - 'RpbContent', + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + 'RpbContent', 'content', 4, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'w', 5, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'dw', 6, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BOOL(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BOOL(), 'return_body', 7, undef ], @@ -93,8 +93,8 @@ use Google::ProtocolBuffers; 'RpbListBucketsResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_REPEATED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REPEATED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'buckets', 1, undef ], @@ -108,8 +108,8 @@ use Google::ProtocolBuffers; 'RpbGetBucketResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - 'RpbBucketProps', + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + 'RpbBucketProps', 'props', 1, undef ], @@ -123,18 +123,18 @@ use Google::ProtocolBuffers; 'RpbGetReq', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'bucket', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'key', 2, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'r', 3, undef ], @@ -148,8 +148,8 @@ use Google::ProtocolBuffers; 'RpbGetBucketReq', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'bucket', 1, undef ], @@ -163,18 +163,18 @@ use Google::ProtocolBuffers; 'RpbLink', [ [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'bucket', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'key', 2, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'tag', 3, undef ], @@ -188,13 +188,13 @@ use Google::ProtocolBuffers; 'RpbGetResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_REPEATED(), - 'RpbContent', + Google::ProtocolBuffers::Constants::LABEL_REPEATED(), + 'RpbContent', 'content', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'vclock', 2, undef ], @@ -208,13 +208,13 @@ use Google::ProtocolBuffers; 'RpbPair', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'key', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'value', 2, undef ], @@ -228,13 +228,13 @@ use Google::ProtocolBuffers; 'RpbPutResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_REPEATED(), - 'RpbContent', + Google::ProtocolBuffers::Constants::LABEL_REPEATED(), + 'RpbContent', 'content', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'vclock', 2, undef ], @@ -248,18 +248,18 @@ use Google::ProtocolBuffers; 'RpbDelReq', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'bucket', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'key', 2, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'rw', 3, undef ], @@ -273,13 +273,13 @@ use Google::ProtocolBuffers; 'RpbMapRedReq', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'request', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'content_type', 2, undef ], @@ -293,18 +293,18 @@ use Google::ProtocolBuffers; 'RpbMapRedResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'phase', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'response', 2, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BOOL(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BOOL(), 'done', 3, undef ], @@ -318,8 +318,8 @@ use Google::ProtocolBuffers; 'RpbGetClientIdResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'client_id', 1, undef ], @@ -333,13 +333,13 @@ use Google::ProtocolBuffers; 'RpbErrorResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'errmsg', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'errcode', 2, undef ], @@ -353,13 +353,13 @@ use Google::ProtocolBuffers; 'RpbBucketProps', [ [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'n_val', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BOOL(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BOOL(), 'allow_mult', 2, undef ], @@ -373,13 +373,13 @@ use Google::ProtocolBuffers; 'RpbGetServerInfoResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'node', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'server_version', 2, undef ], @@ -393,8 +393,8 @@ use Google::ProtocolBuffers; 'RpbListKeysReq', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'bucket', 1, undef ], @@ -408,13 +408,13 @@ use Google::ProtocolBuffers; 'RpbListKeysResp', [ [ - Google::ProtocolBuffers::Constants::LABEL_REPEATED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REPEATED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'keys', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BOOL(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BOOL(), 'done', 2, undef ], @@ -428,48 +428,48 @@ use Google::ProtocolBuffers; 'RpbContent', [ [ - Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_REQUIRED(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'value', 1, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'content_type', 2, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'charset', 3, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'content_encoding', 4, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_BYTES(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_BYTES(), 'vtag', 5, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REPEATED(), - 'RpbLink', + Google::ProtocolBuffers::Constants::LABEL_REPEATED(), + 'RpbLink', 'links', 6, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'last_mod', 7, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), - Google::ProtocolBuffers::Constants::TYPE_UINT32(), + Google::ProtocolBuffers::Constants::LABEL_OPTIONAL(), + Google::ProtocolBuffers::Constants::TYPE_UINT32(), 'last_mod_usecs', 8, undef ], [ - Google::ProtocolBuffers::Constants::LABEL_REPEATED(), - 'RpbPair', + Google::ProtocolBuffers::Constants::LABEL_REPEATED(), + 'RpbPair', 'usermeta', 9, undef ], diff --git a/t/03_delete_object.t b/t/03_delete_object.t index f2d6d10..d2cccf4 100644 --- a/t/03_delete_object.t +++ b/t/03_delete_object.t @@ -16,5 +16,5 @@ test_riak { ok $obj->exists, " exists after delete"; $obj->load; ok !$obj->exists, "object don't exists after load"; - is scalar(@{$bucket->get_keys}), 0, "no keys left in bucket"; + is scalar(@{$bucket->get_keys}), 0, "no keys left in bucket"; }; diff --git a/t/05_object_siblings.t b/t/05_object_siblings.t index 4bdec63..173c669 100644 --- a/t/05_object_siblings.t +++ b/t/05_object_siblings.t @@ -10,7 +10,7 @@ test_riak { ok $bucket->allow_multiples, 'multiples set to 1'; { - # test bucket still has multiples sep li + # test bucket still has multiples sep li my $client = new_riak_client($proto); my $bucket = $client->bucket($bucket_name); ok $bucket->allow_multiples, 'bucket multiples set to 1'; @@ -21,7 +21,7 @@ test_riak { is $obj->has_siblings, 0, 'has no sibilings'; is $obj->count_siblings, 0, 'has no sibilings'; } - + for(1..5) { my $client = new_riak_client($proto); my $bucket = $client->bucket($bucket_name); @@ -33,10 +33,10 @@ test_riak { my $obj = $bucket->get('foo'); ok $obj->has_siblings, 'object has siblings'; is $obj->count_siblings, 5, 'got 5 siblings'; - + my @siblings = $obj->siblings; my $obj3 = $obj->sibling(3); - + is_deeply $obj3->data, $obj->sibling(3)->data, 'sibling data matches'; $obj3 = $obj->sibling(3); $obj3->store; diff --git a/t/11_get_keys.t b/t/11_get_keys.t index 3c771a6..c19f82d 100644 --- a/t/11_get_keys.t +++ b/t/11_get_keys.t @@ -6,7 +6,7 @@ test_riak { my ($client, $bucket_name) = @_; my $bucket = $client->bucket($bucket_name); - + for (1..4) { my $obj = $bucket->new_object("foo$_", [ "foo_test" ]); ok $obj->store, 'object is stored'; @@ -14,13 +14,13 @@ test_riak { my $keys = $bucket->get_keys; - is_deeply [sort @$keys], [ map { "foo$_" } 1..4 ], "got keys"; + is_deeply [sort @$keys], [ map { "foo$_" } 1..4 ], "got keys"; my @keys2; $bucket->get_keys( { - stream => 'true', + stream => 'true', cb => sub { ok 1, "call back called for $_[0]"; push @keys2, $_[0]; diff --git a/t/lib/Test/Riak.pm b/t/lib/Test/Riak.pm index 6ec13ab..f36526f 100644 --- a/t/lib/Test/Riak.pm +++ b/t/lib/Test/Riak.pm @@ -22,7 +22,7 @@ sub test_riak (&) { sub test_riak_rest (&) { my ($test_case) = @_; - + if ($ENV{RIAK_REST_HOST}) { diag "Running for REST"; my $client = Net::Riak->new(host => $ENV{RIAK_REST_HOST}, r => 1, w => 1, dw => 1); @@ -37,7 +37,7 @@ sub test_riak_rest (&) { sub test_riak_pbc (&) { my ($test_case) = @_; - + if ($ENV{RIAK_PBC_HOST}) { diag "Running for PBC"; @@ -55,7 +55,7 @@ sub test_riak_pbc (&) { isa_ok $client, 'Net::Riak'; is $client->is_alive, 1, 'connected'; run_test_case($test_case, $client, 'PBC'); - } + } else { diag "Skipping PBC tests - RIAK_PBC_HOST not set"; } -- cgit 1.4.1