Buckets and Clusters
The Couchbase Java SDK provides an API for managing a Couchbase cluster programmatically.
Unresolved include directive in modules/concept-docs/pages/buckets-and-clusters.adoc - include::7.1@sdk:shared:partial$clusters-buckets.adoc[]
Management operations in the Java SDK may be performed through several interfaces depending on the object:
Creating and Removing Buckets
To create or delete a bucket, call the bucket manager with the buckets()
call on the cluster:
BucketManager manager = cluster.buckets();
bucketSettings = BucketSettings.create("myBucket");
manager.createBucket(bucketSettings);
This class is also used to expose information about an existing bucket (manager.getBucket(string)
) or to update an existing bucket (manager.updateBucket(bucketSettings)
).
The default Collection & Default Scope will be used automatically.