public synchronized Bucket getBucket(String bucketName, List<String> clusterNodes,
      CouchbaseEnvironmentConfigs configs) {
    String bucketId = getBucketId(bucketName, clusterNodes);
    String clusterId = getClusterId(clusterNodes);
    if (!openedClusters.containsKey(clusterId)) {
      openedClusters.put(clusterId, openCluster(clusterNodes, configs));
    }
    if (!openedBuckets.containsKey(bucketId)) {
      openedBuckets.put(bucketId, openBucket(bucketName, openedClusters.get(clusterId)));
    }
    bucketUsageCounts.put(bucketId, bucketUsageCounts.getOrDefault(bucketId, 0) + 1);
    clusterUsageCounts.put(clusterId, clusterUsageCounts.getOrDefault(clusterId, 0) + 1);
    return openedBuckets.get(bucketId);
  }
A synchronized method to open a bucket given the bucket name and cluster nodes. Once a bucket has been opened,
the reference of the bucket will be stored in the registry, and the same reference will be returned given same
bucket name. Each time this method is called, the counter of usage of the bucket is increased by one.
@param bucketName name of the bucket to be opened
@param clusterNodes list of cluster nodes
@param configs couchbase environment configs
@return A Bucket instance associated with the bucket name and cluster nodes
samza-kv-couchbase/src/main/java/org/apache/samza/table/remote/couchbase/CouchbaseBucketRegistry.java