Why is the data lost in luwak

Kelly McLaughlin kelly at basho.com
Thu Dec 8 11:51:31 EST 2011


Fisher, 

Yeah don't use flush. Make the calls to send to put the data and then call close and you should get the expected behavior.

Kelly

On Dec 7, 2011, at 11:13 PM, vuleetu wrote:

> On Thu, Dec 8, 2011 at 1:57 PM, Kelly McLaughlin <kelly at basho.com> wrote:
>> Fisher,
>> 
>> You need to call luwak_put_stream:close(Ps) to force the flush. That should
>> get it for you. Cheers.
>> 
>> Kelly
> 
> Hi, Kelly
> 
>  RiakNode = 'riak at 127.0.0.1'.
>  {ok, Riak} = riak:client_connect(RiakNode).
>  {ok, RiakFile} = luwak_file:create(Riak, <<"testabc22yeah3">>, dict:new()).
>  Ps = luwak_put_stream:start(Riak, RiakFile, 0, 1000000).
>  luwak_put_stream:send(Ps, <<"1234">>).
>  luwak_put_stream:flush(Ps).
>  {ok, RiakFile2} = luwak_file:get(Riak, <<"testabc22yeah3">>).
>  luwak_file:length(Riak, RiakFile2).      %% Length is 4
>  luwak_put_stream:send(Ps, <<"56789">>).
>  luwak_put_stream:close(Ps).
>  {ok, RiakFile3} = luwak_file:get(Riak, <<"testabc22yeah3">>).
>  luwak_file:length(Riak, RiakFile3).  %% Length still 13
> 
> 
>   After i call close(), I still get the unexpected size(13bytes), is
> this the expected behavior?  Can I not call flush() manually on a
> stream?
> 
>  this is the version info:
>  luwak-1.1.0
>  riak_core-1.0.0          riak_kv-1.0.0            riak_pipe-1.0.0
>  riak_search-1.0.0        riak_sysmon-1.0.0        riakc-1.2.0
> 
> Thanks,
> 
> Fisher
> 
> 
>> 
>> On Dec 7, 2011, at 10:05 PM, vuleetu wrote:
>> 
>> luwak_put_stream:send(Ps, <<"56789">>).
>> luwak_put_stream:flush(Ps).
>> {ok, RiakFile3} = luwak_file:get(Riak, <<"testabc22yeah3">>).
>> luwak_file:length(Riak, RiakFile3).
>> 
>> 
> 
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com




More information about the riak-users mailing list