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

    https://github.com/apache/spark/pull/6672#discussion_r33149671
  
    --- 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 --
    
    > That situation might occur if we're parsing a newer event log using an 
older version of the Spark HistoryServer.
    
    Good point. But actually, I think JsonProtocol only supports 
backward-compatibility. `JsonProtocol.sparkEventFromJson` does not handle 
unknown class names either. Because `ReplayListenerBus` will throw an exception 
if parsing a json event log unsuccessfully, it cannotsupport 
forward-compatibility. 


---
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