Spark学習ノート---SparkStreaming TCPデータソース処理を実現


package demo1

import org.apache.spark._
import org.apache.spark.streaming._
//import org.apache.spark.streaming.StreamingContext._  (spark1.3 upper is not necessary)

/*
  Using this context, we can create a DStream that represents streaming data from a TCP source,
  specified  as hostname (eg.localhost) and port.This lines DStream represents the stream of data
  that will be received from the data server. Each record in this DStream is a line of text.
  Next, we want to split the lines by space characters