The Args list in the configuration is the actual list of arguments when given
to erlang:apply (length of list must match the function arity), not a single
argument that's a list (subtle difference). If you want the latter, make it a
nested list, e.g. [[{option,value}]].
Sean Cribbs <[email protected]>
Developer Advocate
Basho Technologies, Inc.
http://basho.com/
On Sep 13, 2010, at 10:04 PM, Joseph Lambert wrote:
> I found that changing
>
> erlang:apply(Module, Function, [Id] ++ Args);
>
> to
>
> Module:Function([Id] ++ Args);
>
> in basho_bench_valgen, got rid of the error. I'm not sure the reason why.
>
>
> - Joe Lambert
>
> [email protected]
>
>
> On Mon, Sep 13, 2010 at 6:38 PM, Joseph Lambert <[email protected]>
> wrote:
> Hi,
>
> I'm trying to create a custom value generator for Basho Bench, but keep
> getting this error:
>
> escript: exception error: no match of right hand side value
> {error,
> {bad_return,
> {{basho_bench_app,start,[normal,[]]},
> {'EXIT',
> {{badmatch,{error,shutdown}},
> [{basho_bench_app,start,2},
> {application_master,start_it_old,4}]}}}}}
> in function basho_bench:main/1
> in call from escript:run/2
> in call from escript:start/1
> in call from init:start_it/1
> in call from init:start_em/1
>
> =INFO REPORT==== 13-Sep-2010::18:21:50 ===
> application: basho_bench
> exited: {bad_return,{{basho_bench_app,start,[normal,[]]},
> {'EXIT',{{badmatch,{error,shutdown}},
> [{basho_bench_app,start,2},
> {application_master,start_it_old,4}]}}}}
> type: permanent
>
> It seems to fail right when it calls erlang:apply() on the function, and
> never seems to enter my custom function.
>
> I have this in the basho bench config file:
>
> {value_generator, {function, rpbc_thread_gen, new_thread, [{user_count,
> 10000}] } }.
>
> Args is just passing in a tuple list, and my rpbc_thread_gen module looks
> like this:
>
> new_thread(Args) ->
> fun() -> do_new_thread(Args) end.
>
> do_new_thread simply returns binary, but like I said, it never seems to enter
> the new_thread() function.
>
> I've also made sure to add my module to the modules list in the .app file and
> all the example tests run fine.
>
> I'm not sure what I am missing here, hopefully someone can point me in the
> right direction.
>
> Another question, is there anyway to pass the generated key to my custom
> value generator, or do I also need to write a new driver as well?
>
> Thanks!
>
> - Joe Lambert
>
> [email protected]
>
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com