You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/04/12 19:23:36 UTC

[GitHub] [pulsar-client-go] hunter2046 commented on a change in pull request #507: Expose NumPartitions() method on producer interface and GetHashingFunction() method

hunter2046 commented on a change in pull request #507:
URL: https://github.com/apache/pulsar-client-go/pull/507#discussion_r611894151



##########
File path: pulsar/producer.go
##########
@@ -199,3 +204,15 @@ type Producer interface {
 	// of errors, pending writes will not be retried.
 	Close()
 }
+
+// GetHashingFunction return the corresponding hashing function for the hashing scheme
+func GetHashingFunction(s HashingScheme) func(string) uint32 {

Review comment:
       We would like to mimic what the default router does including the hash function. The only difference would be to use a snapshotted numPartitions instead of a latest one that is from `TopicMetadata`: https://github.com/apache/pulsar-client-go/blob/6ab17dcca28db389ab91a4a2ea6e5ae990d613da/pulsar/producer_impl.go#L103




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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