Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/2851#discussion_r24833573 --- 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 -- If you really want a suggestion here :-): com.google.common.primitives.Longs.compare(this.id, that.id)
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org