Skip to content

Commit 4b92a20

Browse files
committed
Issue apache#318 : minor style updates per review from Reynold Xin
1 parent 7379b29 commit 4b92a20

File tree

10 files changed

+2
-33
lines changed

10 files changed

+2
-33
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ public final class JavaHdfsLR {
3535
private static final int D = 10; // Number of dimensions
3636
private static final Random rand = new Random(42);
3737

38-
private JavaHdfsLR() {
39-
}
40-
4138
static class DataPoint implements Serializable {
4239
DataPoint(double[] x, double y) {
4340
this.x = x;
@@ -57,7 +54,7 @@ public DataPoint call(String line) {
5754
double y = Double.parseDouble(tok[0]);
5855
double[] x = new double[D];
5956
for (int i = 0; i < D; i++) {
60-
x[i] = Double.parseDouble(tok[i+1]);
57+
x[i] = Double.parseDouble(tok[i + 1]);
6158
}
6259
return new DataPoint(x, y);
6360
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ public final class JavaKMeans {
3636

3737
private static final Pattern SPACE = Pattern.compile(" ");
3838

39-
private JavaKMeans() {
40-
}
41-
4239
/** Parses numbers split by whitespace to a vector */
4340
static Vector parseVector(String line) {
4441
String[] splits = SPACE.split(line);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ public final class JavaLogQuery {
5454
public static final Pattern apacheLogRegex = Pattern.compile(
5555
"^([\\d.]+) (\\S+) (\\S+) \\[([\\w\\d:/]+\\s[+\\-]\\d{4})\\] \"(.+?)\" (\\d{3}) ([\\d\\-]+) \"([^\"]+)\" \"([^\"]+)\".*");
5656

57-
private JavaLogQuery() {
58-
}
59-
6057
/** Tracks the total query count and number of aggregate bytes for a particular group. */
6158
public static class Stats implements Serializable {
6259

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
package org.apache.spark.examples;
1919

20-
import org.apache.spark.SparkContext;
2120
import scala.Tuple2;
2221
import org.apache.spark.api.java.JavaPairRDD;
2322
import org.apache.spark.api.java.JavaRDD;
@@ -43,9 +42,6 @@
4342
public final class JavaPageRank {
4443
private static final Pattern SPACES = Pattern.compile("\\s+");
4544

46-
private JavaPageRank() {
47-
}
48-
4945
private static class Sum extends Function2<Double, Double, Double> {
5046
@Override
5147
public Double call(Double a, Double b) {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
/** Computes an approximation to pi */
2929
public final class JavaSparkPi {
3030

31-
private JavaSparkPi() {
32-
}
33-
3431
public static void main(String[] args) throws Exception {
3532
if (args.length == 0) {
3633
System.err.println("Usage: JavaLogQuery <master> [slices]");

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ public final class JavaTC {
3737
private static final int numVertices = 100;
3838
private static final Random rand = new Random(42);
3939

40-
private JavaTC() {
41-
}
42-
4340
static List<Tuple2<Integer, Integer>> generateGraph() {
4441
Set<Tuple2<Integer, Integer>> edges = new HashSet<Tuple2<Integer, Integer>>(numEdges);
4542
while (edges.size() < numEdges) {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
public final class JavaWordCount {
3333
private static final Pattern SPACE = Pattern.compile(" ");
3434

35-
private JavaWordCount() {
36-
}
37-
3835
public static void main(String[] args) throws Exception {
3936
if (args.length < 2) {
4037
System.err.println("Usage: JavaWordCount <master> <file>");

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333
/**
3434
* Example using MLLib ALS from Java.
3535
*/
36-
public final class JavaALS {
37-
38-
private JavaALS() {
39-
}
36+
public final class JavaALS {
4037

4138
static class ParseRating extends Function<String, Rating> {
4239
private static final Pattern COMMA = Pattern.compile(",");

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
*/
3333
public final class JavaKMeans {
3434

35-
private JavaKMeans() {
36-
}
37-
3835
static class ParsePoint extends Function<String, double[]> {
3936
private static final Pattern SPACE = Pattern.compile(" ");
4037

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
*/
3535
public final class JavaLR {
3636

37-
private JavaLR() {
38-
}
39-
4037
static class ParsePoint extends Function<String, LabeledPoint> {
4138
private static final Pattern COMMA = Pattern.compile(",");
4239
private static final Pattern SPACE = Pattern.compile(" ");

0 commit comments

Comments
 (0)