NOTE this partitioner is deprecated and shouldn't be used. To use default partitioning logic remove partitioner. class configuration setting. See KIP-794 for more info. The default partitioning strategy:渣翻+个人理解如下:
- If a partition is specified in the record, use it
- If no partition is specified but a key is present choose a partition based on a hash of the key
- If no partition or key is present choose the sticky partition that changes when the batch is full. See KIP-480 for details about sticky partitioning.
趁便吐槽一下这个方法目前也已经 了,螺旋式上升是吧根据 PR#11326 内的说法,没有实现这个方法导致 Partitioner 会调用两次 partition()。所以体现出来的就是:0-(+1+1)->2-(+1+1)->4 ...(理论上如果是从 1 开始的话就都是奇数了,但是没有发现)
欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) | Powered by Discuz! X3.4 |