mapred with erlang and mapred_funterm() as strfun

Ilyushonak Barys barys_ilyushonak at troika.ru
Tue Jul 10 09:08:32 EDT 2012


Thank you for your time!
I have solved the issue. I had the R14 and Riak 1.0.0 in the ring.
Everything works fine after I installed latest version from git master.

Regards,
Boris

From: riak-users-bounces at lists.basho.com [mailto:riak-users-bounces at lists.basho.com] On Behalf Of Ilyushonak Barys
Sent: Monday, July 09, 2012 3:41 PM
To: 'Sean Cribbs'
Cc: riak-users at lists.basho.com
Subject: RE: mapred with erlang and mapred_funterm() as strfun

Sean, thank you for note about production.
The value of allow_strfun is set to true on all mine Riak nodes and client application.

Is there any possibility to use Riak mapred as Erlang functions without copying source code to all nodes?

Regards,
Boris

From: Sean Cribbs [mailto:sean at basho.com]
Sent: Monday, July 09, 2012 3:32 PM
To: Ilyushonak Barys
Cc: riak-users at lists.basho.com
Subject: Re: mapred with erlang and mapred_funterm() as strfun

Hello Boris,

We do not advise using the strfun functionality in production, for obvious security and stability reasons. That said, you can enable it on all of your nodes by adding  this setting to the 'riak_kv' section of your app.config file: {allow_strfun, true}

Cheers,
On Mon, Jul 9, 2012 at 6:41 AM, Ilyushonak Barys <barys_ilyushonak at troika.ru<mailto:barys_ilyushonak at troika.ru>> wrote:
Hello,

Could you please shed light on howto use strfun type in mapred query?

As I see, strfun was introduces as a solution for inability to use anonymous functions in Erlang mapred syntax  (http://lists.basho.com/pipermail/riak-users_lists.basho.com/2010-September/001918.html).
I have tried the following code:

{ok, C} = riak:client_connect('riak at 1.2.3.4<mailto:riak at 1.2.3.4>').
MapFun = "fun(Input, undefined, none) -> [{BinData, ObjStatus} || {BinData, ObjStatus} <- [riak_object:get_value(Input)], ObjStatus == 1] end.".
C:mapred(<<"test_bucket">>, [{map, {strfun, MapFun}, none, true}]).

But with no luck.
I got on Riak cluster:
[error] gen_fsm <0.30923.28> in state executing terminated with reason: {error,{error,{badfun,#Fun<erl_eval.18.82930912>},[{riak_kv_mapper,run_map,9},{riak_kv_mapper,'-do_map/2-fun-0-',9},{lists,foldl,3},{riak_kv_mapper,do_map,2},{gen_fsm,handle_msg,7},{proc_lib,init_p_do_apply,3}]}}
[error] CRASH REPORT Process <0.30923.28> with 0 neighbours crashed with reason: {error,{error,{badfun,#Fun<erl_eval.18.82930912>},[{riak_kv_mapper,run_map,9},{riak_kv_mapper,'-do_map/2-fun-0-',9},{lists,foldl,3},{riak_kv_mapper,do_map,2},{gen_fsm,handle_msg,7},{proc_lib,init_p_do_apply,3}]}}
[error] Supervisor luke_phase_sup had child undefined started with {luke_phase,start_link,undefined} at <0.30923.28> exit with reason {error,{error,{badfun,#Fun<erl_eval.18.82930912>},[{riak_kv_mapper,run_map,9},{riak_kv_mapper,'-do_map/2-fun-0-',9},{lists,foldl,3},{riak_kv_mapper,do_map,2},{gen_fsm,handle_msg,7},{proc_lib,init_p_do_apply,3}]}} in context child_terminated

Please, advice.

PS. I use 3 node cluster, and my client runs on separate machine. I have tried the code above with local_client on riak node and it works well.

Regards,
Boris

_______________________________________________________



The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia.

If you need assistance please contact our Contact Center (+7495) 258 0500<tel:%28%2B7495%29%20258%200500> or go to www.troika.ru/eng/Contacts/system.wbp<http://www.troika.ru/eng/Contacts/system.wbp>



_______________________________________________
riak-users mailing list
riak-users at lists.basho.com<mailto:riak-users at lists.basho.com>
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com



--
Sean Cribbs <sean at basho.com<mailto:sean at basho.com>>
Software Engineer
Basho Technologies, Inc.
http://basho.com/


_______________________________________________________

The information contained in this message may be privileged and conf idential and protected from disclosure. If you are not the original intended recipient, you are hereby notified that any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information is prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and delete it from your computer. Thank you for your cooperation. Troika Dialog, Russia. 
If you need assistance please contact our Contact Center  (+7495) 258 0500 or go to www.troika.ru/eng/Contacts/system.wbp  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120710/219ee45e/attachment.html>


More information about the riak-users mailing list