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.
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com