(String, Int)
我有一个包含元组的dstream
当我尝试combineByKey
时,它说我指定参数:Partitioner
my_dstream.combineByKey(
(v) => (v,1),
(acc:(Int, Int), v) => (acc._1 + v, acc._2 + 1),
(acc1:(Int, Int), acc2:(Int, Int)) => (acc1._1 + acc2._1, acc1._2 + acc2._2)
)
但是,当我在 rdd 上使用它时,它可以正常工作:
my_dstream.foreachRDD( rdd =>
rdd.combineByKey(
(v) => (v,1),
(acc:(Int, Int), v) => (acc._1 + v, acc._2 + 1),
(acc1:(Int, Int), acc2:(Int, Int)) => (acc1._1 + acc2._1, acc1._2 + acc2._2)
))
我在哪里可以得到这个分区器?