Skip to content

Commit

Permalink
throw IllegalArgumentException
Browse files Browse the repository at this point in the history
  • Loading branch information
wangfei committed May 10, 2014
1 parent 14d18ac commit cf38bcf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ class ExternalAppendOnlyMap[K, V, C](
val memoryFraction = sparkConf.getDouble("spark.shuffle.memoryFraction", 0.3)
val safetyFraction = sparkConf.getDouble("spark.shuffle.safetyFraction", 0.8)
if (memoryFraction > 1 && memoryFraction < 0) {
throw new Exception("spark.shuffle.memoryFraction should be between 0 and 1.")
throw new IllegalArgumentException("spark.shuffle.memoryFraction should be between 0 and 1.")
}
if (safetyFraction > 1 && safetyFraction < 0) {
throw new Exception("spark.shuffle.safetyFraction should be between 0 and 1.")
throw new IllegalArgumentException("spark.shuffle.safetyFraction should be between 0 and 1.")
}
(Runtime.getRuntime.maxMemory * memoryFraction * safetyFraction).toLong
}
Expand Down

0 comments on commit cf38bcf

Please sign in to comment.