diff options
author | Matei Alexandru Zaharia <matei@apache.org> | 2014-04-19 04:50:46 +0000 |
---|---|---|
committer | Matei Alexandru Zaharia <matei@apache.org> | 2014-04-19 04:50:46 +0000 |
commit | 285def76f7a85939fef4dd2aaa39b21d661141f3 (patch) | |
tree | c22fd9e5399156ccf821490f413a4d736f789a4c /site | |
parent | f848dad94491c7340e8d72a1e1e90a514a2d0ebc (diff) | |
download | spark-website-285def76f7a85939fef4dd2aaa39b21d661141f3.tar.gz spark-website-285def76f7a85939fef4dd2aaa39b21d661141f3.tar.bz2 spark-website-285def76f7a85939fef4dd2aaa39b21d661141f3.zip |
Fix typo in example
Diffstat (limited to 'site')
-rw-r--r-- | site/examples.html | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/site/examples.html b/site/examples.html index 5cc8be1a2..3ae9afb79 100644 --- a/site/examples.html +++ b/site/examples.html @@ -272,13 +272,13 @@ previous ones, and <em>actions</em>, which kick off a job to execute on a cluste <div class="tab-pane tab-pane-java"> <div class="code code-tab"> JavaRDD<String> file = spark.textFile(<span class="string">"hdfs://..."</span>);<br /> - JavaRDD<String> words = file.<span class="sparkop">flatMap</span>(<span class="closure">new FlatMapFunction<String, String>()<br /> + JavaRDD<String> words = file.<span class="sparkop">flatMap</span>(<span class="closure">new FlatMapFunction<String, String>() {<br /> public Iterable<String> call(String s) { return Arrays.asList(s.split(" ")); }<br /> }</span>);<br /> - JavaPairRDD<String, Integer> pairs = words.<span class="sparkop">map</span>(<span class="closure">new PairFunction<String, String, Integer>()<br /> + JavaPairRDD<String, Integer> pairs = words.<span class="sparkop">map</span>(<span class="closure">new PairFunction<String, String, Integer>() {<br /> public Tuple2<String, Integer> call(String s) { return new Tuple2<String, Integer>(s, 1); }<br /> }</span>);<br /> - JavaPairRDD<String, Integer> counts = pairs.<span class="sparkop">reduceByKey</span>(<span class="closure">new Function2<Integer, Integer>()<br /> + JavaPairRDD<String, Integer> counts = pairs.<span class="sparkop">reduceByKey</span>(<span class="closure">new Function2<Integer, Integer>() {<br /> public Integer call(Integer a, Integer b) { return a + b; }<br /> }</span>);<br /> counts.<span class="sparkop">saveAsTextFile</span>(<span class="string">"hdfs://..."</span>); |