我正在使用Spark 2.2,Scala 2.11和GraphX。当我尝试在Intellij中编译以下代码时,我收到错误Cannot resolve symbol mapReduceTriplets
:
val nodeWeightMapFunc = (e:EdgeTriplet[VD,Long]) => Iterator((e.srcId,e.attr), (e.dstId,e.attr))
val nodeWeightReduceFunc = (e1:Long,e2:Long) => e1+e2
val nodeWeights = graph.mapReduceTriplets(nodeWeightMapFunc,nodeWeightReduceFunc)
我正在阅读here,可以用mapReduceTriplets
替换aggregateMessages
,但目前还不清楚我该怎么做?
答案 0 :(得分:3)
mapReduceTriplets
属于旧版API,已从公共API中删除。具体来说,如果您选中Microsoft's Troubleshooting Common Problems with Web Deploy:
在早期版本的GraphX中,使用mapReduceTriplets运算符
完成了邻域聚合