1919import com .couchbase .client .core .logging .CouchbaseLoggerFactory ;
2020import com .couchbase .client .core .service .ServiceType ;
2121import com .couchbase .client .core .utils .NetworkAddress ;
22+ import com .couchbase .client .deps .com .fasterxml .jackson .annotation .JacksonInject ;
2223import com .couchbase .client .deps .com .fasterxml .jackson .annotation .JsonCreator ;
2324import com .couchbase .client .deps .com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
2425import com .couchbase .client .deps .com .fasterxml .jackson .annotation .JsonProperty ;
2728import java .util .*;
2829import java .util .stream .Collectors ;
2930
31+ import static com .couchbase .client .core .logging .RedactableArgument .meta ;
3032import static com .couchbase .client .core .logging .RedactableArgument .system ;
3133
3234/**
@@ -50,25 +52,27 @@ public class DefaultCouchbaseBucketConfig extends AbstractBucketConfig implement
5052 /**
5153 * Creates a new {@link CouchbaseBucketConfig}.
5254 *
53- * @param rev the revision of the config.
54- * @param name the name of the bucket.
55- * @param uri the URI for this bucket.
56- * @param streamingUri the streaming URI for this bucket.
55+ * @param rev the revision of the config.
56+ * @param name the name of the bucket.
57+ * @param uri the URI for this bucket.
58+ * @param streamingUri the streaming URI for this bucket.
5759 * @param partitionInfo partition info for this bucket.
58- * @param nodeInfos related node information.
59- * @param portInfos port info for the nodes, including services.
60+ * @param nodeInfos related node information.
61+ * @param portInfos port info for the nodes, including services.
6062 */
6163 @ JsonCreator
6264 public DefaultCouchbaseBucketConfig (
6365 @ JsonProperty ("rev" ) long rev ,
66+ @ JsonProperty ("uuid" ) String uuid ,
6467 @ JsonProperty ("name" ) String name ,
6568 @ JsonProperty ("uri" ) String uri ,
6669 @ JsonProperty ("streamingUri" ) String streamingUri ,
6770 @ JsonProperty ("vBucketServerMap" ) CouchbasePartitionInfo partitionInfo ,
6871 @ JsonProperty ("nodes" ) List <NodeInfo > nodeInfos ,
6972 @ JsonProperty ("nodesExt" ) List <PortInfo > portInfos ,
70- @ JsonProperty ("bucketCapabilities" ) List <BucketCapabilities > bucketCapabilities ) {
71- super (name , BucketNodeLocator .VBUCKET , uri , streamingUri , nodeInfos , getPortInfos (portInfos ), bucketCapabilities );
73+ @ JsonProperty ("bucketCapabilities" ) List <BucketCapabilities > bucketCapabilities ,
74+ @ JacksonInject ("origin" ) NetworkAddress origin ) {
75+ super (uuid , name , BucketNodeLocator .VBUCKET , uri , streamingUri , nodeInfos , getPortInfos (portInfos ), bucketCapabilities , origin );
7276 this .partitionInfo = partitionInfo ;
7377 this .tainted = partitionInfo .tainted ();
7478 List <NodeInfo > extendedNodeInfos = this .nodes (); // includes ports for SSL services
@@ -92,12 +96,12 @@ private static List<PortInfo> getPortInfos(List<PortInfo> portInfos) {
9296 /**
9397 * Pre-computes a set of nodes that have primary partitions active.
9498 *
95- * @param nodeInfos the list of nodes.
99+ * @param nodeInfos the list of nodes.
96100 * @param partitions the partitions.
97101 * @return a set containing the addresses of nodes with primary partitions.
98102 */
99103 private static Set <NetworkAddress > buildNodesWithPrimaryPartitions (final List <NodeInfo > nodeInfos ,
100- final List <Partition > partitions ) {
104+ final List <Partition > partitions ) {
101105 Set <NetworkAddress > nodes = new HashSet <NetworkAddress >(nodeInfos .size ());
102106 for (Partition partition : partitions ) {
103107 int index = partition .master ();
@@ -111,7 +115,7 @@ private static Set<NetworkAddress> buildNodesWithPrimaryPartitions(final List<No
111115 /**
112116 * Helper method to reference the partition hosts from the raw node list.
113117 *
114- * @param nodeInfos the node infos.
118+ * @param nodeInfos the node infos.
115119 * @param partitionInfo the partition info.
116120 * @return a ordered reference list for the partition hosts.
117121 */
@@ -251,13 +255,13 @@ public boolean ephemeral() {
251255 @ Override
252256 public String toString () {
253257 return "DefaultCouchbaseBucketConfig{"
254- + "name='" + name () + '\''
255- + ", locator=" + locator ()
256- + ", uri='" + uri () + '\''
257- + ", streamingUri='" + streamingUri () + '\''
258- + ", nodeInfo=" + nodes ()
259- + ", partitionInfo=" + partitionInfo
260- + ", tainted=" + tainted
261- + ", rev=" + rev + '}' ;
258+ + "name='" + name () + '\''
259+ + ", locator=" + locator ()
260+ + ", uri='" + uri () + '\''
261+ + ", streamingUri='" + streamingUri () + '\''
262+ + ", nodeInfo=" + nodes ()
263+ + ", partitionInfo=" + partitionInfo
264+ + ", tainted=" + tainted
265+ + ", rev=" + rev + '}' ;
262266 }
263267}
0 commit comments