Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
del throws
  • Loading branch information
zhengruifeng committed Mar 18, 2016
commit 09ad928e3f5efde847eae324b648bfed227c0f34
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static void main(String[] args) {
JavaDStream<BinarySample> data = ssc.textFileStream(dataDir).map(
new Function<String, BinarySample>() {
@Override
public BinarySample call(String line) throws Exception {
public BinarySample call(String line) {
String[] ts = line.split(",");
boolean label = Boolean.valueOf(ts[0]);
double value = Double.valueOf(ts[1]);
Expand All @@ -101,12 +101,12 @@ public BinarySample call(String line) throws Exception {

out.foreachRDD(new VoidFunction<JavaRDD<StreamingTestResult>>() {
@Override
public void call(JavaRDD<StreamingTestResult> rdd) throws Exception {
public void call(JavaRDD<StreamingTestResult> rdd) {
timeoutCounter -= 1;

boolean anySignificant = ! rdd.filter(new Function<StreamingTestResult, Boolean>() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(No space after "!")
Looking good, thank you for indulging. The example is now about as close as possible to the scala version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, the space is removed.

@Override
public Boolean call(StreamingTestResult v) throws Exception {
public Boolean call(StreamingTestResult v) {
return v.pValue() < 0.05;
}
}).isEmpty();
Expand Down