用idea编译spark源码出现错误 not found: type SparkFlumeProtocol...not found: type EventBatch

用idea编译spark源码出现错误 not found: type SparkFlumeProtocol...not found: type EventBatch在使用 sbt 对 spark 源代码进行编译之后 流程请查看上一篇博客 http blog csdn net zhaoyunxiang article details 使用 idea 来 build 源代码时可能会出现如下错误 Error 45 66 notfound typeSparkFlu notfound typesparkflu

在使用sbt对spark源代码进行编译之后(流程请查看上一篇博客用idea编译spark源码出现错误 not found: type SparkFlumeProtocol...not found: type EventBatch),使用idea来build源代码时可能会出现

如下错误:

Error:(45, 66) not found: type SparkFlumeProtocol
  val transactionTimeout: Int, val backOffInterval: Int) extends SparkFlumeProtocol with Logging {
                                                                 ^

...

Error:(25, 27) not found: type EventBatch
  def isErrorBatch(batch: EventBatch): Boolean = {
                          ^

Error:(86, 51) not found: type SparkFlumeProtocol
    val responder = new SpecificResponder(classOf[SparkFlumeProtocol], handler.get)
                                                  ^

这一堆错误都出现在spark源码目录的external文件夹中...

解决方案:

我觉得出现这个问题的原因还是在对源码进行gen-idea的过程中下载需要的jar包时出现问题导致需要的jar包不全,我现在虽然可以编译成功了,但是具体的解决方案仍然不清楚,因为我同时做了如下2件事:

1.依次:View -> Tool Windows -> Maven Projects ->Generate Sources and Update Folders For All Projects(两个箭头首尾相连的那个按钮),然后等待...(这个过程如果你需要关闭idea,请随意,因为重启idea后他会继续...)

2.重复在spark源码目录下进行sbt->gen-idea的操作,让他自己在那下载不用管

然后过了随机长度的时间后你再重新build spark的源代码的时候,你就会发现突然通了...(虽然会有超级多的警告)

另外一种暴力点的方法就是将intelj没有下载到的文件手动添加到对应目录,这是个非常快速的方法,如果有需要的话,请在下面留下联系方式,我可以发给你对应的文件。

参考文献:
http://guozhongxin.com/pages/2014/10/15/spark_source_code.html
http://stackoverflow.com/questions//building-spark1-2-0-codebase-with-intellij-idea

今天的文章 用idea编译spark源码出现错误 not found: type SparkFlumeProtocol...not found: type EventBatch分享到此就结束了,感谢您的阅读。
编程小号
上一篇 2024-12-26 21:17
下一篇 2024-12-26 21:11

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/bian-cheng-ji-chu/96525.html