-
创建SparkStreamingContext
1)val conf=new SparkConf().setMaster(“local[2]”).setAppName(“wordcount”)
val streamContext=new StreamingContext(conf,Seconds(5))
2)val sps=new StreamingContext(new SparkContext(conf),Seconds(5))
//如果关闭的时候只想关闭StreamingContext不想关闭SparkContext则
sps.stop(false)
原创文章,作者:carmelaweatherly,如若转载,请注明出处:https://blog.ytso.com/tech/opensource/198057.html