Hi, I have a cluster with old 0.13.0 riak nodes installed. Erlang native API client is used to get/put data to/from the cluster. Now I'm trying to start using protobuf client (riakc_pb_socket). The problem is that the pb client can't read data saved with old native riak_client. Steps to reproduce:
1> {ok, C} = riak:client_connect('riak@localhost'). {ok,{riak_client,riak@localhost,<<4,81,114,138>>}} 2> C:put(riak_object:new(<<"test">>, <<"key">>, {1, 2})). ok 3> C:get(<<"test">>, <<"key">>). {ok,{r_object,<<"test">>,<<"key">>, [{r_content,{dict,2,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],...}, {{[],[],[],[],[],[],[],[],[],[],...}}}, {1,2}}], [{<<106,124,17,114,80,92,14,183>>,{1,63515448872}}, {<<7,141,174,80>>,{1,63515448872}}, {<<131,98,4,179,111,197>>,{1,63515729078}}, {<<5,81,122,124>>,{1,63515729078}}, {<<4,81,114,138>>,{1,63515729568}}, {<<131,98,3,57,103,94>>,{1,63515729568}}], {dict,1,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],...}, {{[],[],[],[],[],[],[],[],[],[],[],...}}}, undefined}} 4> {ok, Pid} = riakc_pb_socket:start_link("localhost", 8087). {ok,<0.13770.0>} 5> riakc_pb_socket:get(Pid, <<"test">>, <<"key">>). ** exception exit: disconnected On erlang node, the following error occurs: =ERROR REPORT==== 24-Sep-2012::22:12:48 === ** Generic server <0.4086.41> terminating ** Last message in was {tcp,#Port<0.96519>, [9|<<10,4,116,101,115,116,18,3,107,101,121>>]} ** When Server state == {state,#Port<0.96519>, {riak_client,riak@localhost ,<<3,139,240,244>>}, undefined,undefined} ** Reason for termination == ** {function_clause,[{riakclient_pb,encode,[1,{1,2}]}, {riakclient_pb,pack,5}, {riakclient_pb,iolist,2}, {riakclient_pb,encode,2}, {riakclient_pb,pack,5}, {riakclient_pb,pack,5}, {riakclient_pb,iolist,2}, {riakc_pb,encode,1}]} I suppose that it is somehow connected with the fact that the value is passed as an erlang term, not as clear binary data ({1, 2} vs term_to_binary({1, 2})). Is there something I can do about that? Btw, where can I find riakclient_pb.erl source code?
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com