Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/src/main/scala/org/apache/spark/storage/BlockManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ private[spark] class BlockManager(
conf.getBoolean("spark.shuffle.service.enabled", false)
private val chunkSize =
conf.getSizeAsBytes("spark.storage.memoryMapLimitForTests", Int.MaxValue.toString).toInt
private val remoteReadNioBufferConversion =
conf.getBoolean("spark.network.remoteReadNioBufferConversion", false)

val diskBlockManager = {
// Only perform cleanup if an external service is not serving our shuffle files.
Expand Down Expand Up @@ -731,7 +733,14 @@ private[spark] class BlockManager(
}

if (data != null) {
return Some(ChunkedByteBuffer.fromManagedBuffer(data, chunkSize))
// SPARK-24307 undocumented "escape-hatch" in case there are any issues in converting to
// ChunkedByteBuffer, to go back to old code-path. Can be removed post Spark 2.4 if
// new path is stable.
if (remoteReadNioBufferConversion) {
return Some(new ChunkedByteBuffer(data.nioByteBuffer()))
} else {
return Some(ChunkedByteBuffer.fromManagedBuffer(data, chunkSize))
}
}
logDebug(s"The value of block $blockId is null")
}
Expand Down