pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] merlimat commented on a change in pull request #1009: Add optional key/value metadata to producers.
Date Thu, 01 Jan 1970 00:00:00 GMT
merlimat commented on a change in pull request #1009: Add optional key/value metadata to producers.
URL: https://github.com/apache/incubator-pulsar/pull/1009#discussion_r158583896
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java
 ##########
 @@ -83,12 +89,17 @@ public Producer(Topic topic, ServerCnx cnx, long producerId, String producerName
         this.msgIn = new Rate();
         this.isNonPersistentTopic = topic instanceof NonPersistentTopic;
         this.msgDrop = this.isNonPersistentTopic ? new Rate() : null;
+
+        this.metadata = metadata != null
+                ? Collections.unmodifiableMap(new HashMap<>(metadata)) : Collections.emptyMap();
 
 Review comment:
   do we need `new HashMap<>(metadata)` here? could it just be `metadata`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message