You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by andrewor14 <gi...@git.apache.org> on 2014/09/02 18:17:40 UTC

[GitHub] spark pull request: [SPARK-2845] Add timestamps to block manager e...

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

    https://github.com/apache/spark/pull/654#discussion_r16997720
  
    --- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
    @@ -467,12 +469,14 @@ private[spark] object JsonProtocol {
       def blockManagerAddedFromJson(json: JValue): SparkListenerBlockManagerAdded = {
         val blockManagerId = blockManagerIdFromJson(json \ "Block Manager ID")
         val maxMem = (json \ "Maximum Memory").extract[Long]
    -    SparkListenerBlockManagerAdded(blockManagerId, maxMem)
    +    val time = Utils.jsonOption(json \ "Timestamp").map(_.extract[Long]).getOrElse(-1L)
    +    SparkListenerBlockManagerAdded(time, blockManagerId, maxMem)
       }
     
       def blockManagerRemovedFromJson(json: JValue): SparkListenerBlockManagerRemoved = {
         val blockManagerId = blockManagerIdFromJson(json \ "Block Manager ID")
    -    SparkListenerBlockManagerRemoved(blockManagerId)
    +    val time = (json \ "Timestamp").extract[Option[Long]].getOrElse(-1L)
    --- End diff --
    
    minor: `jsonOption` here, as you have done in L472?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org