Yes, it is thread safe, you can treat them as singleton instances per bucket, the following order is the kind of the general usage pattern:

 * Fetch bucket.
 * Optional: If exists verify it has your application values (N value, etc)
 * If doesn't exist create it with your settings.
 * Cache it as a singleton instance (You could create a /"final
   Map<String, Bucket> buckets=new HashMap<>()"/) and re-use it in your
   application; assuming your initialization is not lazy, or if it is
   use proper thread safety initialization.

Hope that helps,

Guido.

On 31/07/13 08:45, Nico Huysamen wrote:
Is the Bucket class reusable and thread-safe? I.e. can I create my Bucket objects during instantiation of client class, and then reuse the same bucket for all operations for the application lifetime? Or should buckets be re-created for each request?

Thanks

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

Reply via email to