Bucket creation.

Alexander Sicular siculars at gmail.com
Tue Feb 5 18:16:44 EST 2013


"buckets" are a virtual concept. you dont need to "create" them. just write
a key to any bucket. also by modifying the default bucket parameters, by
adding the search hook on a bucket, let's say, you are also "creating" the
bucket.

-alexander

On Tue, Feb 5, 2013 at 6:09 PM, Kevin Burton <rkevinburton at charter.net>wrote:

> ** **
>
> I have filed to find code that would create a bucket. It must be in the
> past I have just put objects into a bucket and Riak must construct the
> bucket if it does not exist. Now I would like to create the bucket and set
> some properties on that bucket. But I don’t know how to create the bucket.
> ****
>
> ** **
>
> So I have code like:****
>
> ** **
>
>                             BuildProduct(source, destination);****
>
>                             RiakObject value = new RiakObject("products",
> keySku, JsonConvert.SerializeObject(destination))****
>
>                                 {****
>
>                                     ContentType = "application/json"****
>
>                                 };****
>
> ** **
>
>                             RiakResult<RiakObject> response =
> client.Put(value, new RiakPutOptions { W = 2 });****
>
> ** **
>
> But I would like to create the bucket and set properties on the bucket
> before I put things into the bucket. Like:****
>
> ** **
>
>             RiakResult<RiakBucketProperties> riakBuckpropertiesResult =
> client.GetBucketProperties("products", true);****
>
>             if (riakBuckpropertiesResult.IsSuccess)****
>
>             {****
>
>                 riakBuckpropertiesResult.Value****
>
>                                         .SetNVal(4)****
>
>                                         .SetAllowMultiple(true)****
>
>                                         .SetWVal("all")****
>
>                                         .SetRVal("quorum");****
>
>                 client.SetBucketProperties("products",
> riakBuckpropertiesResult.Value);****
>
>             }****
>
> ** **
>
> The problem is that the properties that I want to set are for a bucket
> that doesn’t exist yet so the “get” fails.****
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20130205/1ce8e26c/attachment.html>


More information about the riak-users mailing list