-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-39636][CORE][UI] Fix multiple bugs in JsonProtocol, impacting off heap StorageLevels and Task/Executor ResourceRequests #37027
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
Changes from all 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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -512,6 +512,7 @@ private[spark] object JsonProtocol { | |||||||||||||||
| def storageLevelToJson(storageLevel: StorageLevel): JValue = { | ||||||||||||||||
| ("Use Disk" -> storageLevel.useDisk) ~ | ||||||||||||||||
| ("Use Memory" -> storageLevel.useMemory) ~ | ||||||||||||||||
| ("Use Off Heap" -> storageLevel.useOffHeap) ~ | ||||||||||||||||
| ("Deserialized" -> storageLevel.deserialized) ~ | ||||||||||||||||
| ("Replication" -> storageLevel.replication) | ||||||||||||||||
| } | ||||||||||||||||
|
|
@@ -750,15 +751,15 @@ private[spark] object JsonProtocol { | |||||||||||||||
|
|
||||||||||||||||
| def executorResourceRequestFromJson(json: JValue): ExecutorResourceRequest = { | ||||||||||||||||
| val rName = (json \ "Resource Name").extract[String] | ||||||||||||||||
| val amount = (json \ "Amount").extract[Int] | ||||||||||||||||
| val amount = (json \ "Amount").extract[Long] | ||||||||||||||||
|
Contributor
Author
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.
spark/core/src/main/scala/org/apache/spark/resource/ExecutorResourceRequest.scala Lines 52 to 58 in 2925896
|
||||||||||||||||
| val discoveryScript = (json \ "Discovery Script").extract[String] | ||||||||||||||||
| val vendor = (json \ "Vendor").extract[String] | ||||||||||||||||
| new ExecutorResourceRequest(rName, amount, discoveryScript, vendor) | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| def taskResourceRequestFromJson(json: JValue): TaskResourceRequest = { | ||||||||||||||||
| val rName = (json \ "Resource Name").extract[String] | ||||||||||||||||
| val amount = (json \ "Amount").extract[Int] | ||||||||||||||||
| val amount = (json \ "Amount").extract[Double] | ||||||||||||||||
|
Contributor
Author
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.
spark/core/src/main/scala/org/apache/spark/resource/TaskResourceRequest.scala Lines 35 to 38 in 2925896
|
||||||||||||||||
| new TaskResourceRequest(rName, amount) | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -1202,9 +1203,19 @@ private[spark] object JsonProtocol { | |||||||||||||||
| def storageLevelFromJson(json: JValue): StorageLevel = { | ||||||||||||||||
| val useDisk = (json \ "Use Disk").extract[Boolean] | ||||||||||||||||
| val useMemory = (json \ "Use Memory").extract[Boolean] | ||||||||||||||||
| // The "Use Off Heap" field was added in Spark 3.4.0 | ||||||||||||||||
| val useOffHeap = jsonOption(json \ "Use Off Heap") match { | ||||||||||||||||
| case Some(value) => value.extract[Boolean] | ||||||||||||||||
| case None => false | ||||||||||||||||
| } | ||||||||||||||||
| val deserialized = (json \ "Deserialized").extract[Boolean] | ||||||||||||||||
| val replication = (json \ "Replication").extract[Int] | ||||||||||||||||
| StorageLevel(useDisk, useMemory, deserialized, replication) | ||||||||||||||||
| StorageLevel( | ||||||||||||||||
| useDisk = useDisk, | ||||||||||||||||
| useMemory = useMemory, | ||||||||||||||||
| useOffHeap = useOffHeap, | ||||||||||||||||
| deserialized = deserialized, | ||||||||||||||||
| replication = replication) | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| def blockStatusFromJson(json: JValue): BlockStatus = { | ||||||||||||||||
|
|
||||||||||||||||
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.
useOffHeapfield was added in Spark 1.0 in PR SPARK-1305: Support persisting RDD's directly to Tachyon #158 and was persisted to JsonProtocol as a "Use Tachyon" field (since that was the original meaning of that field).OFF_HEAPstorage level for use with off-heap caching, but overlooked the fact that that theuseOffHeapfield was no longer being recorded inJsonProtocol