Skip to content

Commit

Permalink
Simplify checks
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewor14 committed Sep 25, 2014
1 parent e30ffac commit c5400cd
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,9 @@ private[spark] class ClientArguments(args: Array[String], sparkConf: SparkConf)
* This is intended to be called only after the provided arguments have been parsed.
*/
private def validateArgs(): Unit = {
Map[Boolean, String](
(numExecutors <= 0) -> "You must specify at least 1 executor!"
).foreach { case (errorCondition, errorMessage) =>
if (errorCondition) {
throw new IllegalArgumentException(errorMessage + "\n" + getUsageMessage())
}
if (numExecutors <= 0) {
throw new IllegalArgumentException(
"You must specify at least 1 executor!\n" + getUsageMessage())
}
}

Expand Down

0 comments on commit c5400cd

Please sign in to comment.