-
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-4467] fix elements read count for ExtrenalSorter #3302
Changes from 2 commits
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 |
---|---|---|
|
@@ -36,7 +36,11 @@ private[spark] trait Spillable[C] { | |
protected def spill(collection: C): Unit | ||
|
||
// Number of elements read from input since last spill | ||
protected var elementsRead: Long | ||
protected var elementsRead: Long = 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. This should now become a |
||
|
||
// subclass calls this method to notify reading an element | ||
// it's used to check spilling frequency | ||
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. Can you rephrase this a little
or something |
||
protected def addElementsRead = elementsRead += 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. Add parentheses to this and call it with |
||
|
||
// Memory manager that can be used to acquire/release memory | ||
private[this] val shuffleMemoryManager = SparkEnv.get.shuffleMemoryManager | ||
|
@@ -76,6 +80,7 @@ private[spark] trait Spillable[C] { | |
|
||
spill(collection) | ||
|
||
elementsRead = 0 | ||
// Keep track of spills, and release memory | ||
_memoryBytesSpilled += currentMemory | ||
releaseMemoryForThisThread() | ||
|
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.
you still need the
()
here and everywhere this is used