Skip to content

Commit e851ca7

Browse files
committed
Fixed long lines
1 parent 50eb0bf commit e851ca7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mllib/src/test/scala/org/apache/spark/mllib/regression/StreamingLinearRegressionSuite.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ class StreamingLinearRegressionSuite extends FunSuite with TestSuiteBase {
140140
val output: Seq[Seq[(Double, Double)]] = runStreams(ssc, numBatches, numBatches)
141141

142142
// compute the mean absolute error and check that it's always less than 0.1
143-
val errors = output.map(batch => batch.map(
144-
p => math.abs(p._1 - p._2)).reduce(_+_) / nPoints.toDouble)
143+
val errors = output.map(batch => batch.map(p => math.abs(p._1 - p._2)).sum / nPoints)
145144
assert(errors.forall(x => x <= 0.1))
146145

147146
}

streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ trait TestSuiteBase extends FunSuite with BeforeAndAfter with Logging {
242242
logInfo("numBatches = " + numBatches + ", numExpectedOutput = " + numExpectedOutput)
243243

244244
// Get the output buffer
245-
val outputStream = ssc.graph.getOutputStreams.filter(_.isInstanceOf[TestOutputStreamWithPartitions[_]]).head.asInstanceOf[TestOutputStreamWithPartitions[V]]
245+
val outputStream = ssc.graph.getOutputStreams.
246+
filter(_.isInstanceOf[TestOutputStreamWithPartitions[_]]).
247+
head.asInstanceOf[TestOutputStreamWithPartitions[V]]
246248
val output = outputStream.output
247249

248250
try {

0 commit comments

Comments
 (0)