Github user tdas commented on a diff in the pull request: https://github.com/apache/spark/pull/830#discussion_r12822294 --- Diff: docs/streaming-programming-guide.md --- @@ -83,21 +82,21 @@ import org.apache.spark.streaming.api._ val ssc = new StreamingContext("local", "NetworkWordCount", Seconds(1)) {% endhighlight %} -Using this context, we then create a new DStream -by specifying the IP address and port of the data server. +Using this context, we can create a DStream that represents streaming data from TCP +source hostname (`localhost`) and port (`9999`). {% highlight scala %} // Create a DStream that will connect to serverIP:serverPort, like localhost:9999 -val lines = ssc.socketTextStream("localhost", 9999) +import org.apache.spark.streaming.dstream._ +val lines: DStream[String] = ssc.socketTextStream("localhost", 9999) {% endhighlight %} -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 +Each record in this DStream is a line of text. Next, we want to split the lines by space into words. {% highlight scala %} // Split each line into words -val words = lines.flatMap(_.split(" ")) +val words: DStream[String] = lines.flatMap(_.split(" ")) --- End diff -- Same as above.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---