Last active
April 12, 2018 16:49
-
-
Save aeppert/9a623fb6973696e45f8074353796370a to your computer and use it in GitHub Desktop.
Revisions
-
aeppert revised this gist
Apr 12, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class RRPartitionerCb : public RdKafka::PartitionerCb { const std::string *key, int32_t partition_cnt, void *msg_opaque) { if((partition+1) > (partition_cnt-1)) { partition = 0; return partition; } -
aeppert created this gist
Apr 12, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ class RRPartitionerCb : public RdKafka::PartitionerCb { public: RRPartitionerCb() { partition = 0; } int32_t partitioner_cb(const RdKafka::Topic *topic, const std::string *key, int32_t partition_cnt, void *msg_opaque) { if(partition > (partition_cnt-1) || (partition + 1) > (partition_cnt-1)) { partition = 0; return partition; } partition++; return partition; } private: int32_t partition; };