0
在我的groovy(spock)單元測試中,我構建了一個JavaDStream,然後嘗試用它來處理每個RDD。當我嘗試使用foreachRDD或接受一個函數作爲參數通過傳遞常規閉合我得到過載問題的其他類似的方法:嘗試將閉包作爲函數傳遞給JavaDStream時重載
Cannot resolve which method to invoke for [class someClass] due to overlapping prototypes between:
[interface org.apache.spark.api.java.function.Function]
[interface org.apache.spark.api.java.function.Function2]
[interface org.apache.spark.api.java.function.VoidFunction]
[interface org.apache.spark.api.java.function.VoidFunction2]
我試着做一些與此類似:
JavaDStream wordStream = buildWordStream(textInputStream)
wordStream.foreachRDD({rdd,time -> println rdd.toString()})
這是什麼導致了上述輸出。