Example of using Riak local client to PUT
21: O = riak_object:new(<<"bucketfoo">>,
<<"bar">>,
"baz",
dict:from_list([{<<"content-type">>,
"text/plain"}]))
-> {r_object,<<"bucketfoo">>,<<"bar">>,
[{r_content,{dict,1,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
{{[],[],[],[],[],[],[],[],[],[],[[...]],[],...}}},
"baz"}],
[],
{dict,1,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...},
{{[],[],[],[],[],[],[],[],[],[],[[<<...>>|...]],[],[],...}}},
undefined}
Creating an instance of local client
22: {ok,C} = riak:local_client()
-> {ok,{riak_client,['riak@10.42.0.6',undefined]}}
PUT'ing the data into Riak
23: C:put(O)
-> ok
ok
GET'ing the data from Riak
24: C:get(<<"bucketfoo">>,<<"bar">>).
{ok,{r_object,<<"bucketfoo">>,<<"bar">>,
[{r_content,{dict,4,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],...},
{{[],[],[],[],[],[],[],[],[],[],...}}},
"baz"}],
[{<<213,131,199,167,84,19,35,47>>,{1,63577762836}}],
{dict,1,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],...},
{{[],[],[],[],[],[],[],[],[],[],[],...}}},
undefined}}