Skip to content

Commit 17faa3a

Browse files
author
Kostas Sakellis
committed
Removed AtomicLong in favour of using Long
1 parent b6f9923 commit 17faa3a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,23 +248,23 @@ case class InputMetrics(readMethod: DataReadMethod.Value) {
248248
/**
249249
* Total bytes read.
250250
*/
251-
private val _bytesRead: AtomicLong = new AtomicLong()
252-
def bytesRead: Long = _bytesRead.get()
253-
def incBytesRead(bytes: Long) = _bytesRead.addAndGet(bytes)
251+
private var _bytesRead: Long = _
252+
def bytesRead: Long = _bytesRead
253+
def incBytesRead(bytes: Long) = _bytesRead += bytes
254254

255255
/**
256256
* Total records read.
257257
*/
258-
def recordsRead: Long = _recordsRead.get()
259-
private val _recordsRead: AtomicLong = new AtomicLong()
260-
def incRecordsRead(records: Long) = _recordsRead.addAndGet(records)
258+
private var _recordsRead: Long = _
259+
def recordsRead: Long = _recordsRead
260+
def incRecordsRead(records: Long) = _recordsRead += records
261261

262262
/**
263263
* Invoke the bytesReadCallback and mutate bytesRead.
264264
*/
265265
def updateBytesRead() {
266266
bytesReadCallback.foreach { c =>
267-
_bytesRead.set(c())
267+
_bytesRead = c()
268268
}
269269
}
270270

0 commit comments

Comments
 (0)