diff options
author | Imran Rashid <imran@quantifind.com> | 2013-01-28 10:08:59 -0800 |
---|---|---|
committer | Imran Rashid <imran@quantifind.com> | 2013-01-28 20:07:53 -0800 |
commit | 0f22c4207f27bc8d1675af82f873141dda754f5c (patch) | |
tree | 1c1a5e34597253f40d806b78ea35b14fc0fa0a42 /core/src/main | |
parent | a423ee546c389b5ce0d2117299456712370d7ad1 (diff) | |
download | spark-0f22c4207f27bc8d1675af82f873141dda754f5c.tar.gz spark-0f22c4207f27bc8d1675af82f873141dda754f5c.tar.bz2 spark-0f22c4207f27bc8d1675af82f873141dda754f5c.zip |
better formatting for RDDInfo
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/scala/spark/storage/StorageUtils.scala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/src/main/scala/spark/storage/StorageUtils.scala b/core/src/main/scala/spark/storage/StorageUtils.scala index d6e33c8619..ce7c067eea 100644 --- a/core/src/main/scala/spark/storage/StorageUtils.scala +++ b/core/src/main/scala/spark/storage/StorageUtils.scala @@ -1,6 +1,6 @@ package spark.storage -import spark.SparkContext +import spark.{Utils, SparkContext} import BlockManagerMasterActor.BlockStatus private[spark] @@ -22,8 +22,14 @@ case class StorageStatus(blockManagerId: BlockManagerId, maxMem: Long, } case class RDDInfo(id: Int, name: String, storageLevel: StorageLevel, - numPartitions: Int, memSize: Long, diskSize: Long) - + numPartitions: Int, memSize: Long, diskSize: Long) { + override def toString = { + import Utils.memoryBytesToString + import java.lang.{Integer => JInt} + String.format("RDD \"%s\" (%d) Storage: %s; Partitions: %d; MemorySize: %s; DiskSize: %s", name, id.asInstanceOf[JInt], + storageLevel.toString, numPartitions.asInstanceOf[JInt], memoryBytesToString(memSize), memoryBytesToString(diskSize)) + } +} /* Helper methods for storage-related objects */ private[spark] |