aboutsummaryrefslogtreecommitdiff
path: root/streaming/src/test
diff options
context:
space:
mode:
authorDongjoon Hyun <dongjoon@apache.org>2016-03-10 15:57:22 -0800
committerAndrew Or <andrew@databricks.com>2016-03-10 15:57:22 -0800
commit91fed8e9c57764eca9463d129ecd68196db7f566 (patch)
treeb06c678dc15258af92116019760e6b9c98d81c2d /streaming/src/test
parent81d48532d954a8aea28d7e1fb3aa32a78c708b63 (diff)
downloadspark-91fed8e9c57764eca9463d129ecd68196db7f566.tar.gz
spark-91fed8e9c57764eca9463d129ecd68196db7f566.tar.bz2
spark-91fed8e9c57764eca9463d129ecd68196db7f566.zip
[SPARK-3854][BUILD] Scala style: require spaces before `{`.
## What changes were proposed in this pull request? Since the opening curly brace, '{', has many usages as discussed in [SPARK-3854](https://issues.apache.org/jira/browse/SPARK-3854), this PR adds a ScalaStyle rule to prevent '){' pattern for the following majority pattern and fixes the code accordingly. If we enforce this in ScalaStyle from now, it will improve the Scala code quality and reduce review time. ``` // Correct: if (true) { println("Wow!") } // Incorrect: if (true){ println("Wow!") } ``` IntelliJ also shows new warnings based on this. ## How was this patch tested? Pass the Jenkins ScalaStyle test. Author: Dongjoon Hyun <dongjoon@apache.org> Closes #11637 from dongjoon-hyun/SPARK-3854.
Diffstat (limited to 'streaming/src/test')
-rw-r--r--streaming/src/test/scala/org/apache/spark/streaming/receiver/RateLimiterSuite.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/streaming/src/test/scala/org/apache/spark/streaming/receiver/RateLimiterSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/receiver/RateLimiterSuite.scala
index c6330eb367..ee3817c4b6 100644
--- a/streaming/src/test/scala/org/apache/spark/streaming/receiver/RateLimiterSuite.scala
+++ b/streaming/src/test/scala/org/apache/spark/streaming/receiver/RateLimiterSuite.scala
@@ -25,21 +25,21 @@ class RateLimiterSuite extends SparkFunSuite {
test("rate limiter initializes even without a maxRate set") {
val conf = new SparkConf()
- val rateLimiter = new RateLimiter(conf){}
+ val rateLimiter = new RateLimiter(conf) {}
rateLimiter.updateRate(105)
assert(rateLimiter.getCurrentLimit == 105)
}
test("rate limiter updates when below maxRate") {
val conf = new SparkConf().set("spark.streaming.receiver.maxRate", "110")
- val rateLimiter = new RateLimiter(conf){}
+ val rateLimiter = new RateLimiter(conf) {}
rateLimiter.updateRate(105)
assert(rateLimiter.getCurrentLimit == 105)
}
test("rate limiter stays below maxRate despite large updates") {
val conf = new SparkConf().set("spark.streaming.receiver.maxRate", "100")
- val rateLimiter = new RateLimiter(conf){}
+ val rateLimiter = new RateLimiter(conf) {}
rateLimiter.updateRate(105)
assert(rateLimiter.getCurrentLimit === 100)
}