Skip to content
Snippets Groups Projects
Commit b45857c9 authored by Stephen Haberman's avatar Stephen Haberman
Browse files

Add RDD.toDebugString.

Original idea by Nathan Kronenfeld.
parent f03d9760
No related branches found
No related tags found
No related merge requests found
......@@ -638,4 +638,14 @@ abstract class RDD[T: ClassManifest](
protected[spark] def clearDependencies() {
dependencies_ = null
}
/** A description of this RDD and its recursive dependencies for debugging. */
def toDebugString(): String = {
def debugString(rdd: RDD[_], prefix: String = ""): Seq[String] = {
Seq(prefix + rdd) ++ rdd.dependencies.flatMap(d => debugString(d.rdd, prefix + " "))
}
debugString(this).mkString("\n")
}
override def toString() = "%s[%d] at %s".format(getClass.getSimpleName, id, origin)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment