public class CouchbaseBucketRegistry
extends java.lang.Object
Cluster instance given same clusterNodes and reuse
the same Bucket given same bucketName. Instantiating a Bucket is expensive. Different tasks within a
container that is using the same bucket should use this registry to avoid creating multiple Buckets.| Constructor and Description |
|---|
CouchbaseBucketRegistry()
Constructor of the CouchbaseTableRegistry.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
closeBucket(java.lang.String bucketName,
java.util.List<java.lang.String> clusterNodes)
A synchronized method to close a bucket given the bucket name.
|
com.couchbase.client.java.Bucket |
getBucket(java.lang.String bucketName,
java.util.List<java.lang.String> clusterNodes,
org.apache.samza.table.remote.couchbase.CouchbaseEnvironmentConfigs configs)
A synchronized method to open a bucket given the bucket name and cluster nodes.
|
public CouchbaseBucketRegistry()
public com.couchbase.client.java.Bucket getBucket(java.lang.String bucketName,
java.util.List<java.lang.String> clusterNodes,
org.apache.samza.table.remote.couchbase.CouchbaseEnvironmentConfigs configs)
bucketName - name of the bucket to be openedclusterNodes - list of cluster nodesconfigs - couchbase environment configspublic boolean closeBucket(java.lang.String bucketName,
java.util.List<java.lang.String> clusterNodes)
bucketName - name of the bucket to be openedclusterNodes - list of cluster nodes