Thank you. I noticed that I was trying to set 'dw' and I received an
exception indicating that setting this property with PB client is not
supported. If I want to set this property I need to create an HTTP client?
Are there other properties that this applies to? Creating an HTTP client
just to set the properties on a bucket is somewhat of an annoyance since for
performance reasons I mainly want to use PB. Is this just a work in progress
or is there a major technical hurdle that needs to be overcome to implement
this feature?

-----Original Message-----
From: Brian Roach [mailto:[email protected]] 
Sent: Wednesday, March 20, 2013 9:47 AM
To: Kevin Burton
Cc: [email protected]
Subject: Re: Java driver createBucket/fetchBucket

On Thu, Mar 14, 2013 at 11:25 PM, Kevin Burton <[email protected]>
wrote:
> This sample calls 'createBucket'. First what is the difference between 
> 'createBucket' and 'fetchBucket'? I have an existing bucket so I don't 
> want to create a new one and thereby remove the old one. So I felt 
> that 'fetchBucket' would be the call I should make. The problem is 
> that 'fetchBucket' returns a 'FetchBucket' object that doesn't have 
> the same methods as the 'Bucket' returned by createBucket. I would 
> just like to query the bucket using a key. But that simple operation 
> appears to be unavailable with the 'FetchBucket' object. Ideas?

For the most part all of this is simply semantics to have the Java API model
interacting with Riak in some logical fashion. Nothing ever "removes" a
bucket from Riak. The only difference between a FetchBucket and a
WriteBucket is whether or not the bucket properties are written to Riak when
you call execture().

Calling execute() on a FetchBucket queries Riak for the bucket properties
and returns a Bucket object. If you don't need to read the properties you
can call .lazyLoadBucketProperties() on the FetchBucket prior to calling
execute() and it will not query Riak at all (unless you then call any of the
property getters (e.g. getR() ) on the returned Bucket).

Calling execute() on a WriteBucket (which is returned by
IRiakClient.createBucket() and IRiakClient.updateBucket() - they are exactly
the same thing) does a write to Riak of the properties specified then a
subsequent read of them back from Riak, returning a Bucket object. Again,
the read can be avoided or postponed using
.lazyLoadBucketProperties() prior to execute().


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

Reply via email to