Brian, Where I got lost was the fact that I was using custom Converter and I did not do anything with vclock passed into fromDomain(). That was undetected because at the same time I wasn't using withoutFetch, which I believe is the only moment where missing @RiakVClock annotation can be detected. Normally when JSONConverter is used missing @RiakVClock would also be detected. Could you confirm?
Few additional, related questions: - if I use byte[] or VClock field and use withoutFetch() what is default value it should be set to (since it will be extracted via StoreObject)? - if I want to avoid overwriting deleted keys, I guess I need to set returnDeletedVClock as below, DomainBucketBuilder<Custom> builder = DomainBucket.builder(bucket, Custom.class) builder.returnDeletedVClock(true); and then check isDeleted on sibblings and use ConditionalStoreMutation to return false id one of he sibblings has that flag set to true? I believe it needs to use VClock of deleted sibbling as well? Thanks Daniel The .withoutFetch() method isn't available when using the DomanBucket. > > As for the vector clock, when using .withoutFetch() the .execute() > method of StoreObject is going to extract the vector clock from the > POJO returned from your Mutation by looking for a VectorClock or > byte[] field that is annotated with @RiakVClock. It is then passed to > the Converter's .fromDomain() method as an argument. If you are > storing an object you previously fetched from Riak, that vector clock > and annotation needs to be there. > > The easiest way to implement that is: > 1. Have a VectorClock or byte[] field in your POJO annotated with > @RiakVClock > > 2. When you fetch, in the .toDomain() method of your Converter have > the line of code you noted. > > 3. When you store, the vector clock stored in that field will be > passed to the .fromDomain() method of your Converter. Make sure to > call the .withVClock(vclock) method of the RiakObjectBuilder or > explicitly set it in the IRiakObject being returned. > > - Roach > > > On Fri, Mar 8, 2013 at 3:31 PM, Daniel Iwan <iwan.dan...@gmail.com> wrote: > > Somehow I cannot find a way to avoid pre-fetch during store operation > (Java > > client). > > I know in StoreObject there is withoutFetch method for that purpose but I > > cannot find corresponding method/property in DomainBucket or > > DomainBucketBuilder > > > > Am I missing something? > > > > Also on related note when withoutFetch is used I guess I need to provide > > annotated RiakVClock field and use something like: > > > > VClockUtil.setVClock(domainObject, riakObject.getVClock()); > > > > in my Converter. Is that right or is there better way to do it? > > > > > > I'm using Riak Java client 1.1.0 > > > > Thanks > > Daniel > > > > _______________________________________________ > > riak-users mailing list > > riak-users@lists.basho.com > > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com