Skip to content

Commit

Permalink
Update ExternalAppendOnlyMap.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
wangfei committed May 10, 2014
1 parent a59d76b commit 764965f
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,12 @@ class ExternalAppendOnlyMap[K, V, C](
private val maxMemoryThreshold = {
val memoryFraction = sparkConf.getDouble("spark.shuffle.memoryFraction", 0.3)
val safetyFraction = sparkConf.getDouble("spark.shuffle.safetyFraction", 0.8)

if (memoryFraction > 1 && memoryFraction <= 0) {
if (memoryFraction > 1 && memoryFraction < 0) {
throw new Exception("spark.shuffle.memoryFraction should be between 0 and 1.")
}

if (safetyFraction > 1 && safetyFraction <= 0) {
if (safetyFraction > 1 && safetyFraction < 0) {
throw new Exception("spark.shuffle.safetyFraction should be between 0 and 1.")
}


(Runtime.getRuntime.maxMemory * memoryFraction * safetyFraction).toLong
}

Expand Down

0 comments on commit 764965f

Please sign in to comment.