Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6672#discussion_r33150039
  
    --- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
    @@ -848,6 +908,60 @@ private[spark] object JsonProtocol {
         new ExecutorInfo(executorHost, totalCores, logUrls)
       }
     
    +  def blockUpdatedInfoFromJson(json: JValue): BlockUpdatedInfo = {
    +    BlockUpdatedInfo(
    +      blockManagerIdFromJson(json \ "Block Manager ID"),
    +      blockIdFromJson(json \ "Block ID"),
    +      storageLevelFromJson(json \ "Storage Level"),
    +      (json \ "Memory Size").extract[Long],
    +      (json \ "Disk Size").extract[Long],
    +      (json \ "ExternalBlockStore Size").extract[Long]
    +    )
    +  }
    +
    +  def blockIdFromJson(json: JValue): BlockId = {
    +    val rddBlockId = Utils.getFormattedClassName(RDDBlockId)
    +    val shuffleBlockId = Utils.getFormattedClassName(ShuffleBlockId)
    +    val shuffleDataBlockId = 
Utils.getFormattedClassName(ShuffleDataBlockId)
    +    val shuffleIndexBlockId = 
Utils.getFormattedClassName(ShuffleIndexBlockId)
    +    val broadcastBlockId = Utils.getFormattedClassName(BroadcastBlockId)
    +    val taskResultBlockId = Utils.getFormattedClassName(TaskResultBlockId)
    +    val streamBlockId = Utils.getFormattedClassName(StreamBlockId)
    +
    +    (json \ "Class Name").extract[String] match {
    --- End diff --
    
    BTW. This will throw `scala.MatchError` for an unknown class name.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to