-
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7b899c2
【SPARK-1779】
a59d76b
Throw exception when memoryFracton is out of range
764965f
Update ExternalAppendOnlyMap.scala
dff1f0f
Update BlockManager.scala
14d18ac
throw IllegalArgumentException
cf38bcf
throw IllegalArgumentException
43621bd
&& => ||
2e79b3d
&& => ||
fc45476
validate memoryfraction in sparkconf
717c0ca
updated to make more concise
scwf 829a195
add indent
scwf da6ee59
add configs
scwf 6e385b9
Update SparkConf.scala
scwf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,16 @@ 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) { | ||
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.") | ||
} | ||
|
||
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. nit: can you remove all the blank lines that you added? 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. removed and updated |
||
|
||
(Runtime.getRuntime.maxMemory * memoryFraction * safetyFraction).toLong | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: the value of 0 is technically "between 0 and 1." This should be
memoryFraction < 0
. Someone might want to not use the RDD cache at all and use all memory for spilling, for instance. (though I don't think this is common)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.
(Same in
ExternalAppendOnlyMap
)