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

    https://github.com/apache/spark/pull/2851#discussion_r24833405
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/RDDInfo.scala ---
    @@ -49,9 +50,40 @@ class RDDInfo(
       }
     }
     
    +
     private[spark] object RDDInfo {
       def fromRdd(rdd: RDD[_]): RDDInfo = {
         val rddName = Option(rdd.name).getOrElse(rdd.id.toString)
         new RDDInfo(rdd.id, rddName, rdd.partitions.size, rdd.getStorageLevel)
       }
     }
    +
    +@DeveloperApi
    +class BroadcastInfo(
    +    val id: Long,
    +    val name: String,
    +    val numPartitions: Int) extends Ordered[BroadcastInfo] with 
InMemoryObjectInfo {
    +
    +  var memSize = 0L
    +  var diskSize = 0L
    +  var tachyonSize = 0L
    +
    +  override def toString = {
    +    import Utils.bytesToString
    +    ("%s\" (%d) ; " +
    +      "MemorySize: %s; TachyonSize: %s; DiskSize: %s").format(
    +        name, id, bytesToString(memSize), bytesToString(tachyonSize), 
bytesToString(diskSize))
    +  }
    +
    +  override def compare(that: BroadcastInfo): Int = {
    +    if (this.id > that.id) {
    +      1
    +    } else {
    +      if (this.id == that.id) {
    +        return 0
    +      }
    +      -1
    --- End diff --
    
    super minor:
    ```
    if (this.id > that.id) {
      1
    }  else if (this.is == that.id) {
      0
    }  else {
      -1
    }
    ```
    (sorry I was wrong w/ the earlier suggestion)


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