Skip to content

Commit 42a8701

Browse files
committed
fix volatile
1 parent c3eeedf commit 42a8701

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/src/main/scala/org/apache/spark/util/collection/Spillable.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private[spark] abstract class Spillable[C](taskMemoryManager: TaskMemoryManager)
6161
@volatile private[this] var myMemoryThreshold = initialMemoryThreshold
6262

6363
// Number of elements read from input since last spill
64-
@volatile private[this] var _elementsRead = 0L
64+
private[this] var _elementsRead = 0L
6565

6666
// Number of bytes spilled in total
6767
@volatile private[this] var _memoryBytesSpilled = 0L
@@ -111,7 +111,6 @@ private[spark] abstract class Spillable[C](taskMemoryManager: TaskMemoryManager)
111111
if (!isSpilled) {
112112
0L
113113
} else {
114-
_elementsRead = 0
115114
val freeMemory = myMemoryThreshold - initialMemoryThreshold
116115
_memoryBytesSpilled += freeMemory
117116
releaseMemory()

0 commit comments

Comments
 (0)