hi, 已经尝试过了,通过partitionCustom 返回的是datastream,如果后面接cep的化,并发度就是1了,性能更不上。
Best Wishes. Zhang Yuxiao <[email protected]> 于2020年10月31日周六 上午9:38写道: > 你好, > > 你看看 DataStream 类中的 partitionCustom 方法是否能够符合你的需求? > ________________________________ > 发件人: Peihui He <[email protected]> > 发送时间: 2020年10月30日 下午 07:23 > 收件人: [email protected] <[email protected]> > 主题: flink 1.11.2 keyby 更换partition > > hi,all > > 请问可以更改keyby的hash partition 不? 现在发现这个hash partition不能均匀的分配key。 > > KeyGroupRangeAssignment.assignKeyToParallelOperator(stringToMd5(asset_id), > 128, parallesism) > > 用这个方法测试,即使个asset_id 转换为MD5都不能均匀分配。 > > 相反,用最最简单的 Math.abs(asset_id.hashcode() % parallesism ) 就可以平均的分配key。 > > > Best Regards. >
