Skip to content

Commit 45c8f40

Browse files
committed
Merge branch 'master' of https://github.com/apache/spark into SPARK-1413
2 parents 5e35d87 + e55cc4b commit 45c8f40

35 files changed

+60
-67
lines changed

examples/src/main/java/org/apache/spark/examples/JavaHdfsLR.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,6 @@ public static void main(String[] args) {
138138

139139
System.out.print("Final w: ");
140140
printWeights(w);
141-
System.exit(0);
141+
sc.stop();
142142
}
143143
}

examples/src/main/java/org/apache/spark/examples/JavaLogQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ public Stats call(Stats stats, Stats stats2) {
126126
for (Tuple2<?,?> t : output) {
127127
System.out.println(t._1() + "\t" + t._2());
128128
}
129-
System.exit(0);
129+
jsc.stop();
130130
}
131131
}

examples/src/main/java/org/apache/spark/examples/JavaPageRank.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,6 @@ public Double call(Double sum) {
117117
System.out.println(tuple._1() + " has rank: " + tuple._2() + ".");
118118
}
119119

120-
System.exit(0);
120+
ctx.stop();
121121
}
122122
}

examples/src/main/java/org/apache/spark/examples/JavaTC.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ public Tuple2<Integer, Integer> call(Tuple2<Integer, Integer> e) {
9696
} while (nextCount != oldCount);
9797

9898
System.out.println("TC has " + tc.count() + " edges.");
99-
System.exit(0);
99+
sc.stop();
100100
}
101101
}

examples/src/main/java/org/apache/spark/examples/JavaWordCount.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ public Iterable<String> call(String s) {
4848
return Arrays.asList(SPACE.split(s));
4949
}
5050
});
51-
51+
5252
JavaPairRDD<String, Integer> ones = words.mapToPair(new PairFunction<String, String, Integer>() {
5353
@Override
5454
public Tuple2<String, Integer> call(String s) {
5555
return new Tuple2<String, Integer>(s, 1);
5656
}
5757
});
58-
58+
5959
JavaPairRDD<String, Integer> counts = ones.reduceByKey(new Function2<Integer, Integer, Integer>() {
6060
@Override
6161
public Integer call(Integer i1, Integer i2) {
@@ -67,6 +67,6 @@ public Integer call(Integer i1, Integer i2) {
6767
for (Tuple2<?,?> tuple : output) {
6868
System.out.println(tuple._1() + ": " + tuple._2());
6969
}
70-
System.exit(0);
70+
ctx.stop();
7171
}
7272
}

examples/src/main/java/org/apache/spark/mllib/examples/JavaALS.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,6 @@ public static void main(String[] args) {
8585
outputDir + "/productFeatures");
8686
System.out.println("Final user/product features written to " + outputDir);
8787

88-
System.exit(0);
88+
sc.stop();
8989
}
9090
}

examples/src/main/java/org/apache/spark/mllib/examples/JavaKMeans.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ public static void main(String[] args) {
7979
double cost = model.computeCost(points.rdd());
8080
System.out.println("Cost: " + cost);
8181

82-
System.exit(0);
82+
sc.stop();
8383
}
8484
}

examples/src/main/java/org/apache/spark/mllib/examples/JavaLR.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ public static void main(String[] args) {
7777

7878
System.out.print("Final w: " + model.weights());
7979

80-
System.exit(0);
80+
sc.stop();
8181
}
8282
}

examples/src/main/scala/org/apache/spark/examples/BroadcastTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ object BroadcastTest {
5656
println("Iteration %d took %.0f milliseconds".format(i, (System.nanoTime - startTime) / 1E6))
5757
}
5858

59-
System.exit(0)
59+
sc.stop()
6060
}
6161
}

examples/src/main/scala/org/apache/spark/examples/CassandraCQLTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import org.apache.spark.SparkContext._
5858
prod_id,
5959
quantity) VALUES ('charlie', 1385983649000, 'iphone', 2);
6060
*/
61-
61+
6262
/**
6363
* This example demonstrates how to read and write to cassandra column family created using CQL3
6464
* using Spark.

0 commit comments

Comments
 (0)