riak-erlang-client mapred returns wrong object

Sean Cribbs sean at basho.com
Sat Mar 3 08:06:04 EST 2012

This is because the internal representation (record named riak_object) in
Riak is not identical to the external representation (record named
riakc_obj) in the client. Naturally, the functions in riakc_obj won't work
on the internal record of a different name. There's also no way to convert
a riak_object record directly to a riakc_obj record currently. However, if
you're already using internal modules to riak_kv (as is indicated in your
sample), simply use the riak_object module on those results.

Alternatively, you can use the riakc_pb_socket:get_index/* functions to
retrieve just the keys and then fetch the bucket/key pairs using the get/*

On Sat, Mar 3, 2012 at 4:16 AM, Senthilkumar Peelikkampatti <
senthilkumar.peelikkampatti at gmail.com> wrote:

> riak-erlang-client mapred with riak_kv_mapreduce:map_identity(true) is
> returning riak_object instead of riakc_obj -- I tried multiple times and I
> am not seeing riakc_obj.
> IndexSpec  = {index, bucket(), <<"some_bin">>, Bin}
> riakc_pb_socket:mapred(Pid, IndexSpec,
> [riak_kv_mapreduce:map_identity(true)])
> Note: It is very late night [03:10 AM CST] and I am fiddling with native
> and riak pb client's so I may be wrong. However I crosschecked again and it
> is still returning riak_object but not riakc_obj.
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Sean Cribbs <sean at basho.com>
Software Engineer
Basho Technologies, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120303/d28eb662/attachment.html>

More information about the riak-users mailing list