Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/22371#discussion_r216167054
--- Diff:
core/src/main/scala/org/apache/spark/shuffle/IndexShuffleBlockResolver.scala ---
@@ -138,13 +148,22 @@ private[spark] class IndexShuffleBlockResolver(
mapId: Int,
lengths: Array[Long],
dataTmp: File): Unit = {
+ shuffleIdToLocks.putIfAbsent(shuffleId, new
Array[Object](lengths.length))
--- End diff --
Rather than put, then get, just
`shuffleIdToLocks.computeIfAbsent(shuffleId, () => new
Array[Object](lengths.length))`. Something like that should work and maybe
avoid even creating the array unless it is needed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]