我正在使用apche spark(streaming)下的maven。並通過scala編程。 其實,我有一個小問題,下面的指令:apache spark Streaming error
val sc= new StreamingContext(conf , Seconds(1))
如果我花邊的指令代碼是正確的。
這是我的全部代碼(網絡字數):
import org.apache.spark.SparkConf
import org.apache.spark.streaming.{Seconds, StreamingContext}
import org.apache.spark.storage.StorageLevel
object WordCountStreaming {
def main(args: Array[String]): Unit = {
val conf = new SparkConf() .setMaster("local")
.setAppName("WordCountStreaming")
.set("spark.driver.allowMultipleContexts","true"); val sc= new
StreamingContext(conf , Seconds(1)) val lines =
sc.socketTextStream(args(0), args(1).toInt,
StorageLevel.MEMORY_AND_DISK_SER) sc.start() sc.awaitTermination()
}
}
請添加錯誤日誌和代碼 – Kartoch
進口org.apache.spark.SparkConf 進口org.apache.spark.streaming。{秒,的StreamingContext} 進口org.apache.spark.storage.StorageLevel 對象WordCountStreaming { 高清main(args:Array [String]):Unit = {0,1,2}真正」); val sc = new StreamingContext(conf,Seconds(1)) val lines = sc.socketTextStream(args(0),args(1).toInt,StorageLevel.MEMORY_AND_DISK_SER) sc.start() sc.awaitTermination } } –
你知道你可以添加它的問題(我爲你做的)? – Kartoch