Problem with keys filter in erlang pb client

Dimitry D legato.di at gmail.com
Sun Jul 24 16:04:22 EDT 2011


Hello.

I totally lost my mind with this, but I have to finish it.

I have simple app: it extracts data from txt file (data like "timestamp
 value"), push it to Riak and make some range queries.
The problem is when I make key filter query I get *{error,disconnected}*.
I strore data in riak in this way: key – timestamp (like 0.43), value –
value (like 1.14), bucket – time of adding data (like
"2011-07-24-23-39-45").
Here's the code of request:

(dca_db.erl)

handle_call({range_query, Bucket, From, To}, _, #state{db_pid = Pid} = State)
->

Query = [{map,     %query type

  {modfun, riak_kv_mapreduce, map_object_value},  %function from riak erlang
built-in module

  none, true}],

Inputs = {Bucket, [["between", 0, 1]]},

Result = riakc_pb_socket:mapred(Pid, Inputs, Query),

{reply, Result, State};



(test/dca_db_tests.erl)

   range_request(Pid) ->

Bucket = <<"2011-07-24-23-39-45">>,

Result = gen_server:call(Pid, {range_query, Bucket, 0, 1}),

error_logger:info_msg("RESULT:~p~n",[Result]).



You can find my code in github –
https://github.com/DimitryDushkin/distributed_calc_riak_matlab


Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110725/f62baa23/attachment.html>


More information about the riak-users mailing list