diff options
author | Sean Owen <sowen@cloudera.com> | 2016-01-26 11:55:28 +0000 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-01-26 11:55:28 +0000 |
commit | 649e9d0f5b2d5fc13f2dd5be675331510525927f (patch) | |
tree | cc500b373fda20ef42243c199ecfb6f381310abb /docs | |
parent | 5936bf9fa85ccf7f0216145356140161c2801682 (diff) | |
download | spark-649e9d0f5b2d5fc13f2dd5be675331510525927f.tar.gz spark-649e9d0f5b2d5fc13f2dd5be675331510525927f.tar.bz2 spark-649e9d0f5b2d5fc13f2dd5be675331510525927f.zip |
[SPARK-3369][CORE][STREAMING] Java mapPartitions Iterator->Iterable is inconsistent with Scala's Iterator->Iterator
Fix Java function API methods for flatMap and mapPartitions to require producing only an Iterator, not Iterable. Also fix DStream.flatMap to require a function producing TraversableOnce only, not Traversable.
CC rxin pwendell for API change; tdas since it also touches streaming.
Author: Sean Owen <sowen@cloudera.com>
Closes #10413 from srowen/SPARK-3369.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/streaming-programming-guide.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/streaming-programming-guide.md b/docs/streaming-programming-guide.md index 93c34efb66..7e681b67cf 100644 --- a/docs/streaming-programming-guide.md +++ b/docs/streaming-programming-guide.md @@ -165,8 +165,8 @@ space into words. // Split each line into words JavaDStream<String> words = lines.flatMap( new FlatMapFunction<String, String>() { - @Override public Iterable<String> call(String x) { - return Arrays.asList(x.split(" ")); + @Override public Iterator<String> call(String x) { + return Arrays.asList(x.split(" ")).iterator(); } }); {% endhighlight %} |