2013-10-02 49 views
1

我按照本指南 http://docs.basho.com/riak/latest/dev/advanced/mapreduce/誤差了Riak二郎protobuffs

本指南以下設置5個節點 http://docs.basho.com/riak/latest/quickstart/

start() -> 
    {ok, Client} = riakc_pb_socket:start("127.0.0.1", 10018), 
    Mine = riakc_obj:new(<<"groceries">>, <<"mine">>, 
        term_to_binary(["eggs", "bacon"])), 
    Yours = riakc_obj:new(<<"groceries">>, <<"yours">>, 
         term_to_binary(["bread", "bacon"])), 
    riakc_pb_socket:put(Client, Yours, [{w, 1}]), 
    riakc_pb_socket:put(Client, Mine, [{w, 1}]). 

我運行此查詢,它給這個錯誤後

** Reason for termination == 
** {{badrecord,rpbputreq}, 
[{riak_kv_pb,iolist,2,[{file,"src/riak_kv_pb.erl"},{line,48}]}, 
{riak_kv_pb,encode,2,[{file,"src/riak_kv_pb.erl"},{line,40}]}, 
{riak_pb_codec,encode,1,[{file,"src/riak_pb_codec.erl"},{line,77}]}, 
{riakc_pb_socket,send_request,2, 
        [{file,"src/riakc_pb_socket.erl"},{line,2066}]}, 
{riakc_pb_socket,handle_call,3, 
        [{file,"src/riakc_pb_socket.erl"},{line,1252}]}, 
{gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,588}]}, 
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]} 
** Last message in was {req, 
         {rpbputreq,<<"groceries">>,<<"yours">>,undefined, 
          {rpbcontent, 
           <<131,108,0,0,0,2,107,0,5,98,114,101,97,100, 
           107,0,5,98,97,99,111,110,106>>, 
           undefined,undefined,undefined,undefined,[], 
           undefined,undefined,[],[],undefined}, 
          1,undefined,undefined,undefined,undefined, 
          undefined,undefined,undefined,undefined, 
          undefined,undefined,undefined}, 
         60000} 
** When Server state == {state,"127.0.0.1",10018,false,false,#Port<0.3496>, 
          gen_tcp,undefined, 
          {[],[]}, 
          1,[],infinity,undefined,undefined,undefined, 
          undefined,100} 

的承諾使其

riakc_pb_socket:put(Client, Yours, [{w, 1}]), 

我沒有連接到正在運行的節點的控制檯。我運行二郎這個命令

erl -sname foo -pa ~/e/riak-erlang-client/ebin -pa /usr/lib/riak/lib/riak_kv-1.4.2-0-g61ac9d8/ebin -pa /usr/lib/riak/lib/riak_core-1.4.2/ebin -pa /usr/lib/riak/lib/riak_pb-1.4.1.1/ebin/ 

的不良記錄在

/usr/lib/riak/lib/riak_pb-1.4.1.1/include/riak_kv_pb.hrl 
-record(rpbputreq, { 
bucket = erlang:error({required, bucket}), 
key, 
vclock, 
content = erlang:error({required, content}), 
w, 
dw, 
return_body, 
pw, 
if_not_modified, 
if_none_match, 
return_head, 
timeout, 
asis, 
sloppy_quorum, 
n_val 
}). 

回答

1

riak_pb的最新版本中定義了Riak - 二郎山 - 客戶DEPS在末端

一個額外的「類型」字段
-record(rpbputreq, { 
     bucket = erlang:error({required, bucket}), 
     key, 
     vclock, 
     content = erlang:error({required, content}), 
     w, 
     dw, 
     return_body, 
     pw, 
     if_not_modified, 
     if_none_match, 
     return_head, 
     timeout, 
     asis, 
     sloppy_quorum, 
     n_val, 
     type 
    }). 
+1

呃,所以...問題是你拔的發展分支。該字段不會存在於任何當前的Riak發行版中。這是了Riak 2.0(開發中)的新功能,它是尚未公佈。請參閱:https://github.com/basho/riak/issues/362 –

+0

發佈爲答案,我會接受 –