Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 5125e60

Browse files
committed
Fix style.
1 parent a2eb3b9 commit 5125e60

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

streaming/src/main/scala/org/apache/spark/streaming/dstream/ReceiverInputDStream.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ abstract class ReceiverInputDStream[T: ClassTag](@transient ssc_ : StreamingCont
4444
/**
4545
* Asynchronously maintains & sends new rate limits to the receiver through the receiver tracker.
4646
*/
47-
override protected[streaming] val rateController: Option[RateController] =
48-
if (RateController.isBackPressureEnabled(ssc.conf))
47+
override protected[streaming] val rateController: Option[RateController] = {
48+
if (RateController.isBackPressureEnabled(ssc.conf)) {
4949
RateEstimator.create(ssc.conf).map { new ReceiverRateController(id, _) }
50-
else
50+
} else {
5151
None
52+
}
53+
}
5254

5355
/**
5456
* Gets the receiver object that will be sent to the worker nodes

streaming/src/test/scala/org/apache/spark/streaming/scheduler/RateControllerSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class RateControllerSuite extends TestSuiteBase {
4646
}
4747
}
4848

49-
test("receiver rate controller updates reach receivers") {
49+
test("publish rates reach receivers") {
5050
val ssc = new StreamingContext(conf, batchDuration)
5151
withStreamingContext(ssc) { ssc =>
5252
val dstream = new RateLimitInputDStream(ssc) {
@@ -65,7 +65,7 @@ class RateControllerSuite extends TestSuiteBase {
6565
}
6666
}
6767

68-
test("multiple rate controller updates reach receivers") {
68+
test("multiple publish rates reach receivers") {
6969
val ssc = new StreamingContext(conf, batchDuration)
7070
withStreamingContext(ssc) { ssc =>
7171
val rates = Seq(100L, 200L, 300L)

0 commit comments

Comments
 (0)