GitHub user zsxwing opened a pull request:
https://github.com/apache/spark/pull/3464
[SPARK-4608][Streaming] Reorganize StreamingContext implicit to improve API
convenience
There is only one implicit function `toPairDStreamFunctions` in
`StreamingContext`. This PR did similar reorganization like
[SPARK-4397](https://issues.apache.org/jira/browse/SPARK-4397).
Compiled the following codes with Spark Streaming 1.1.0 and ran it with
this PR. Everything is fine.
```Scala
import org.apache.spark._
import org.apache.spark.streaming._
import org.apache.spark.streaming.StreamingContext._
object StreamingApp {
def main(args: Array[String]) {
val conf = new
SparkConf().setMaster("local[2]").setAppName("FileWordCount")
val ssc = new StreamingContext(conf, Seconds(10))
val lines = ssc.textFileStream("/some/path")
val words = lines.flatMap(_.split(" "))
val pairs = words.map(word => (word, 1))
val wordCounts = pairs.reduceByKey(_ + _)
wordCounts.print()
ssc.start()
ssc.awaitTermination()
}
}
```
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zsxwing/spark SPARK-4608
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/3464.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3464
----
commit c15162c4d3d4582fdd24149f41ba0fad272e2288
Author: zsxwing <[email protected]>
Date: 2014-11-26T02:36:02Z
Reorganize StreamingContext implicit to improve API convenience
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]