1。先看代码解析
/**
* When called inside a class in the spark package, returns the name of the user code class
* (outside the spark package) that called into Spark, as well as which Spark method they called.
* This is used, for example, to tell users where in their code each RDD got created.
*
* 当在spark包中调用类时,返回调用spark的用户代码类的名称,以及它们调用的spark方法。
* 例如,这是用来告诉用户在他们的代码中每个RDD被创建的地方。
*
* @param skipClass Function that is used to exclude non-user-code classes.
* 用于排除非用户代码类的函数。
*
* 功能描述:获取当前SparkContext的当前调用栈,将栈中最靠近栈底的属于Spark或者Scala核心的类压入callStack的栈顶,
* 并将此类的方法存入lastSparkMethod;将栈里最靠近栈顶的用户类放入callStack,将此类的行号存入firstUserline,类名
* 存入firstUserFile,最终返回的样例类CallSite存储了最短栈和长度默认为20的最长栈的样例类。
* 在JavaWordCount例子中,获得的数据如下:
* 最短栈:J