然而,当我重建并运行Spark时,我对代码库所做的任何更改似乎都没有反映出来。例如,在
spark-shell
REPL,初始化将打印
Spark context Web UI available at [some address and port]
. 这部分来自
repl.src.main.scala.org.apache.spark.repl.SparkILoop.scala
link to Github here
),作为
initializationCommands
价值
-
我试着简单地加上
println(s"Spark context Web UI available at
${webUrl}!!!!"
-
build/sbt clean package
-
我开始我的火花壳
bin/spark-shell
感叹号将出现在控制台中。他们没有。我得到了
为了不泄气,我注意到
18/11/28 08:09:20 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
当Spark(和Spark shell)第一次加载到本地机器上(使用Hadoop)时,通常打印为日志消息。很明显,它能够记录警告消息。
我试图通过向
SparkContext
中的构造函数
SparkContext class definition
sc
在火花壳内。我在中编辑了以下几行
class SparkContext(config: SparkConf) extends Logging {
logWarning("Hello!!!!")
/* rest of the constructor code is below */
同样,我遵循了相同的清理和构建过程,并希望看到一些日志消息
Hello!!!!
同样,我看到了没有本机Hadoop的默认警告消息,但没有看到我自己的消息。