spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r1683391 - in /spark: examples.md site/examples.html
Date Wed, 03 Jun 2015 17:14:41 GMT
Author: srowen
Date: Wed Jun  3 17:14:40 2015
New Revision: 1683391

URL: http://svn.apache.org/r1683391
Log:
Fix two Java example typos

Modified:
    spark/examples.md
    spark/site/examples.html

Modified: spark/examples.md
URL: http://svn.apache.org/viewvc/spark/examples.md?rev=1683391&r1=1683390&r2=1683391&view=diff
==============================================================================
--- spark/examples.md (original)
+++ spark/examples.md Wed Jun  3 17:14:40 2015
@@ -137,7 +137,7 @@ In this example, we search through the e
     JavaPairRDD&lt;String, Integer&gt; pairs = words.<span class="sparkop">mapToPair</span>(<span
class="closure">new PairFunction&lt;String, String, Integer&gt;() {<br>
     &nbsp;&nbsp;public Tuple2&lt;String, Integer&gt; call(String s) { return
new Tuple2&lt;String, Integer&gt;(s, 1); }<br>
     }</span>);<br>
-    JavaPairRDD&lt;String, Integer&gt; counts = pairs.<span class="sparkop">reduceByKey</span>(<span
class="closure">new Function2&lt;Integer, Integer&gt;() {<br>
+    JavaPairRDD&lt;String, Integer&gt; counts = pairs.<span class="sparkop">reduceByKey</span>(<span
class="closure">new Function2&lt;Integer, Integer, Integer&gt;() {<br>
     &nbsp;&nbsp;public Integer call(Integer a, Integer b) { return a + b; }<br>
     }</span>);<br>
     counts.<span class="sparkop">saveAsTextFile</span>(<span class="string">"hdfs://..."</span>);
@@ -178,7 +178,7 @@ In this example, we search through the e
   <div class="tab-pane tab-pane-java">
     <div class="code code-tab">
     <span class="keyword">int</span> count = spark.parallelize(makeRange(1, NUM_SAMPLES)).<span
class="sparkop">filter</span>(<span class="closure">new Function&lt;Integer,
Boolean&gt;() {<br>
-    &nbsp;&nbsp;public Integer call(Integer i) {<br>
+    &nbsp;&nbsp;public Boolean call(Integer i) {<br>
     &nbsp;&nbsp;&nbsp;&nbsp;double x = Math.random();<br>
     &nbsp;&nbsp;&nbsp;&nbsp;double y = Math.random();<br>
     &nbsp;&nbsp;&nbsp;&nbsp;return x*x + y*y &lt; 1;<br>

Modified: spark/site/examples.html
URL: http://svn.apache.org/viewvc/spark/site/examples.html?rev=1683391&r1=1683390&r2=1683391&view=diff
==============================================================================
--- spark/site/examples.html (original)
+++ spark/site/examples.html Wed Jun  3 17:14:40 2015
@@ -297,7 +297,7 @@ previous ones, and <em>actions</em>, whi
     JavaPairRDD&lt;String, Integer&gt; pairs = words.<span class="sparkop">mapToPair</span>(<span
class="closure">new PairFunction&lt;String, String, Integer&gt;() {<br />
     &nbsp;&nbsp;public Tuple2&lt;String, Integer&gt; call(String s) { return
new Tuple2&lt;String, Integer&gt;(s, 1); }<br />
     }</span>);<br />
-    JavaPairRDD&lt;String, Integer&gt; counts = pairs.<span class="sparkop">reduceByKey</span>(<span
class="closure">new Function2&lt;Integer, Integer&gt;() {<br />
+    JavaPairRDD&lt;String, Integer&gt; counts = pairs.<span class="sparkop">reduceByKey</span>(<span
class="closure">new Function2&lt;Integer, Integer, Integer&gt;() {<br />
     &nbsp;&nbsp;public Integer call(Integer a, Integer b) { return a + b; }<br
/>
     }</span>);<br />
     counts.<span class="sparkop">saveAsTextFile</span>(<span class="string">"hdfs://..."</span>);
@@ -338,7 +338,7 @@ previous ones, and <em>actions</em>, whi
   <div class="tab-pane tab-pane-java">
     <div class="code code-tab">
     <span class="keyword">int</span> count = spark.parallelize(makeRange(1, NUM_SAMPLES)).<span
class="sparkop">filter</span>(<span class="closure">new Function&lt;Integer,
Boolean&gt;() {<br />
-    &nbsp;&nbsp;public Integer call(Integer i) {<br />
+    &nbsp;&nbsp;public Boolean call(Integer i) {<br />
     &nbsp;&nbsp;&nbsp;&nbsp;double x = Math.random();<br />
     &nbsp;&nbsp;&nbsp;&nbsp;double y = Math.random();<br />
     &nbsp;&nbsp;&nbsp;&nbsp;return x*x + y*y &lt; 1;<br />



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message