Changes based on Matei's comments

This commit is contained in:
Patrick Wendell 2012-09-28 16:04:36 -07:00
Родитель c387e40fb1
Коммит bc909c2903
1 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -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
var finished = false
breakable {
for (el <- trace) {
if (el.getClassName().contains("spark") && !el.getClassName().contains("spark.examples")) {
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()
break
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)