-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-1779] Throw an exception if memory fractions are not between 0 and 1 #714
Changes from 4 commits
7b899c2
a59d76b
764965f
dff1f0f
14d18ac
cf38bcf
43621bd
2e79b3d
fc45476
717c0ca
829a195
da6ee59
6e385b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should or(||) instead of and(&&). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, i made a mistake There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops, good call |
||
throw new Exception("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.") | ||
} | ||
(Runtime.getRuntime.maxMemory * memoryFraction * safetyFraction).toLong | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should throw an IllegalArgumentException.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for that