W dniu 01.04.2011 15:23, Jon Meredith pisze:
> Hi Damian,
> 
> The put FSM is being overhauled at the moment.  The current 0.14.1 code
> does not apply the updated values in precommit hooks.  In my testing it
> worked ok, but I think that is probably because there were already
> values present in Riak and the changes were included at the vnode level.
> 
> You could try building from source on github, the branch the put FSM was
> refactored on has been pulled in now.  There is a QuickCheck test that
> executes code that looks very similar to yours.
> 
>     MD = riak_object:get_metadata(Obj),
>     UpdMD = dict:store(?MD_USERMETA, [{"X-Riak-Meta-PrecommitHook","was
> here"}], MD),
>     riak_object:update_metadata(Obj, UpdMD).
> 
> I'd be very interested to hear if it resolves your problem.
> 
> BR, Jon.
> Basho Technologies.
> 

Well, I have not applied this patch yet, but in meanwhile I looked into
the riak_object source code and found apply_updates/1. I simply called
this one as the last step in my hook function and it worked. Probably
this is not the correct way of solving this problem, is it?

-- D.


> 2011/4/1 Damian Dobroczyński <[email protected] <mailto:[email protected]>>
> 
>     Hi, list!
> 
>     I'm trying to update object metadata dictionary within my precommit hook
>     (in Erlang) using `riak_object:update_metadata/2' like this:
> 
>      Old = riak_object:get_metadata(O),
>      New = dict:store(<<"X-my-metadata-name">>, Value, Old),
>      NewObject = riak_object:update_metadata(O, New),
> 
>     Unfortunately, the retrieved object does not contain the new keys. Where
>     can be the problem?
> 
>     -- D.
> 
>     _______________________________________________
>     riak-users mailing list
>     [email protected] <mailto:[email protected]>
>     http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> 
> 

Attachment: 0x0CAE3AEB.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to