diff options
author | Patrick Wendell <pwendell@gmail.com> | 2012-09-28 16:04:36 -0700 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2012-09-28 16:04:36 -0700 |
commit | bc909c2903f80452b62091c9a32fd7587a41b218 (patch) | |
tree | 67661e3c45af9a090704de0cb7ba7116e830554f /core/src/main | |
parent | c387e40fb1d9ecfccba1ea5869bffe0b2934c80b (diff) | |
download | spark-bc909c2903f80452b62091c9a32fd7587a41b218.tar.gz spark-bc909c2903f80452b62091c9a32fd7587a41b218.tar.bz2 spark-bc909c2903f80452b62091c9a32fd7587a41b218.zip |
Changes based on Matei's comments
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/scala/spark/RDD.scala | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/core/src/main/scala/spark/RDD.scala b/core/src/main/scala/spark/RDD.scala index 8e50ea5853..8590d487cc 100644 --- a/core/src/main/scala/spark/RDD.scala +++ b/core/src/main/scala/spark/RDD.scala @@ -12,7 +12,6 @@ import scala.collection.mutable.ArrayBuffer import scala.collection.Map import scala.collection.mutable.HashMap import scala.collection.JavaConversions.mapAsScalaMap -import scala.util.control.Breaks._ import org.apache.hadoop.io.BytesWritable import org.apache.hadoop.io.NullWritable @@ -142,21 +141,22 @@ abstract class RDD[T: ClassManifest](@transient sc: SparkContext) extends Serial var firstUserMethod = "<not_found>" var firstUserFile = "<not_found>" var firstUserLine = -1 - - breakable { - for (el <- trace) { - if (el.getClassName().contains("spark") && !el.getClassName().contains("spark.examples")) { - lastSparkMethod = el.getMethodName() - } - else { - firstUserMethod = el.getMethodName() - firstUserLine = el.getLineNumber() - firstUserFile = el.getFileName() - break - } + var finished = false + + for (el <- trace) { + if (!finished) { + if (el.getClassName().contains("spark") && !el.getClassName().startsWith("spark.examples")) { + lastSparkMethod = el.getMethodName() + } + else { + firstUserMethod = el.getMethodName() + firstUserLine = el.getLineNumber() + firstUserFile = el.getFileName() + finished = true + } } } - "%s called in %s (%s:%s)".format(lastSparkMethod, firstUserMethod, firstUserFile, firstUserLine) + "%s at: %s (%s:%s)".format(lastSparkMethod, firstUserMethod, firstUserFile, firstUserLine) } // Transformations (return a new RDD) |