1. 核心概念 StreamingContext Create StreamingContext import org.apache.spark._ import org.apache.spark.streaming._ val conf = new SparkConf().setAppName(appName).setMaster(master) //Second(1) #表示处理的批次, 当前1秒处理一次 val ssc = new StreamingContext(conf, Second