Spark生态之Spark Streaming
批处理 & 流处理 为什么需要流处理---更多场景需要? 越来越多的应用需要大规模数据下的实时计算能力 实时舆情分析 Spark Core & RDD本质上是离线运算 val conf=new SparkConf().setAppName("myWordCount") val sc=new SparkContext(conf) //读取数据 val lines=sc.textFile(input) //进行相关计算 val resultRdd=lines .flatMap(_.split(" ")) .map((_,1)) .reduceByKey(_+_) //保存结果 resultRdd.saveAsTextFile(output) Spark Streaming是什么 Spark Streaming is an extension of the core Spark API that enables scalable, high-throughput, fault-tolerant stream processing of li...