Package com.basho.riak.client.bucket

A bucket is a namespace abstraction provided by Riak, the API uses Bucket as the primary way to interact with data stored in Riak.

See: Description

Package com.basho.riak.client.bucket Description

A bucket is a namespace abstraction provided by Riak, the API uses Bucket as the primary way to interact with data stored in Riak.

All data in Riak is stored under a bucket/key namespace. After you have obtained a Bucket from the IRiakClient, use it to fetch, store and delete data.

For example

 
   final String bucketName = UUID.randomUUID().toString();
   
   Bucket b = client.fetchBucket(bucketName).execute();
   //store something
   IRiakObject o = b.store("k", "v").execute();
   //fetch it back
   IRiakObject fetched = b.fetch("k").execute();
   // now update that riak object
   b.store("k", "my new value").execute();
   //fetch it back again
   fetched = b.fetch("k").execute();
   //delete it
   b.delete("k").execute();
 

Bucket extends the BucketProperties interface for access to bucket schema information (like n_val, allow_mult, default r quorum etc.)

This package also provides a DomainBucket for wrapping a Bucket. A DomainBucket simplifies working with a bucket that only has one type of data in it. RiakBucket is a DomainBucket for working with IRiakObjects.

See Also:
Bucket, DomainBucket, RiakBucket

Copyright © 2013. All Rights Reserved.