Skip to content
Snippets Groups Projects
Commit 4b92a202 authored by Sean Owen's avatar Sean Owen
Browse files

Issue #318 : minor style updates per review from Reynold Xin

parent 7379b291
No related branches found
No related tags found
No related merge requests found
Showing
with 2 additions and 33 deletions
......@@ -35,9 +35,6 @@ public final class JavaHdfsLR {
private static final int D = 10; // Number of dimensions
private static final Random rand = new Random(42);
private JavaHdfsLR() {
}
static class DataPoint implements Serializable {
DataPoint(double[] x, double y) {
this.x = x;
......@@ -57,7 +54,7 @@ public final class JavaHdfsLR {
double y = Double.parseDouble(tok[0]);
double[] x = new double[D];
for (int i = 0; i < D; i++) {
x[i] = Double.parseDouble(tok[i+1]);
x[i] = Double.parseDouble(tok[i + 1]);
}
return new DataPoint(x, y);
}
......
......@@ -36,9 +36,6 @@ public final class JavaKMeans {
private static final Pattern SPACE = Pattern.compile(" ");
private JavaKMeans() {
}
/** Parses numbers split by whitespace to a vector */
static Vector parseVector(String line) {
String[] splits = SPACE.split(line);
......
......@@ -54,9 +54,6 @@ public final class JavaLogQuery {
public static final Pattern apacheLogRegex = Pattern.compile(
"^([\\d.]+) (\\S+) (\\S+) \\[([\\w\\d:/]+\\s[+\\-]\\d{4})\\] \"(.+?)\" (\\d{3}) ([\\d\\-]+) \"([^\"]+)\" \"([^\"]+)\".*");
private JavaLogQuery() {
}
/** Tracks the total query count and number of aggregate bytes for a particular group. */
public static class Stats implements Serializable {
......
......@@ -17,7 +17,6 @@
package org.apache.spark.examples;
import org.apache.spark.SparkContext;
import scala.Tuple2;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
......@@ -43,9 +42,6 @@ import java.util.regex.Pattern;
public final class JavaPageRank {
private static final Pattern SPACES = Pattern.compile("\\s+");
private JavaPageRank() {
}
private static class Sum extends Function2<Double, Double, Double> {
@Override
public Double call(Double a, Double b) {
......
......@@ -28,9 +28,6 @@ import java.util.List;
/** Computes an approximation to pi */
public final class JavaSparkPi {
private JavaSparkPi() {
}
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.err.println("Usage: JavaLogQuery <master> [slices]");
......
......@@ -37,9 +37,6 @@ public final class JavaTC {
private static final int numVertices = 100;
private static final Random rand = new Random(42);
private JavaTC() {
}
static List<Tuple2<Integer, Integer>> generateGraph() {
Set<Tuple2<Integer, Integer>> edges = new HashSet<Tuple2<Integer, Integer>>(numEdges);
while (edges.size() < numEdges) {
......
......@@ -32,9 +32,6 @@ import java.util.regex.Pattern;
public final class JavaWordCount {
private static final Pattern SPACE = Pattern.compile(" ");
private JavaWordCount() {
}
public static void main(String[] args) throws Exception {
if (args.length < 2) {
System.err.println("Usage: JavaWordCount <master> <file>");
......
......@@ -33,10 +33,7 @@ import scala.Tuple2;
/**
* Example using MLLib ALS from Java.
*/
public final class JavaALS {
private JavaALS() {
}
public final class JavaALS {
static class ParseRating extends Function<String, Rating> {
private static final Pattern COMMA = Pattern.compile(",");
......
......@@ -32,9 +32,6 @@ import java.util.regex.Pattern;
*/
public final class JavaKMeans {
private JavaKMeans() {
}
static class ParsePoint extends Function<String, double[]> {
private static final Pattern SPACE = Pattern.compile(" ");
......
......@@ -34,9 +34,6 @@ import java.util.regex.Pattern;
*/
public final class JavaLR {
private JavaLR() {
}
static class ParsePoint extends Function<String, LabeledPoint> {
private static final Pattern COMMA = Pattern.compile(",");
private static final Pattern SPACE = Pattern.compile(" ");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment