import Spark source code into intellij, build Error: not found: type SparkFlumeProtocol and EventBatch

import Spark source code into intellij, build Error: not found: type SparkFlumeProtocol and EventBatch

IntelliJ: 14.1.4

Spark: 1.5 发布源代码

我正在将 Spark 源代码导入 IntelliJ,并按照 Spark website 上的步骤操作。

我在构建和编译项目时遇到以下错误。我已经用谷歌搜索并尝试了 "Spark Project External Flume Sink" 的 Maven 工具栏中的 suggested here in spark user list 到 "Generate Sources and Update Folders",但仍然有相同的错误。

我很确定这是一个解决问题,因为所有其他 类 都已成功解决。也许我没有正确使用 IntelliJ?有什么建议吗?

Error:(45, 66) not found: type SparkFlumeProtocol
  val transactionTimeout: Int, val backOffInterval: Int) extends SparkFlumeProtocol with Logging {
                                                                 ^
Error:(70, 39) not found: type EventBatch
  override def getEventBatch(n: Int): EventBatch = {

我已经解决了,结果在默认设置下导入Spark源码时"Spark Project External Flume Sink"被排除

我做了什么:

  1. 文件 -> 项目结构 -> 模块 -> "spark-streaming-flume-sink_2.10" -> 来源
  2. 在文件夹的树形显示中,最初"target"文件夹被排除在外,但是"SparkFlumeProtocol"和"EventBatch"类被编译到这个文件夹中
  3. 将 "target" 文件夹设置为 "Sources",然后将 "target" 下的所有内容保留为 "Excluded","scala-2.10" 除外,见附件截图。

这样就把编译的类都包含进去了,重新build工程后类可以正确解析

--- 2016 年 6 月 8 日更新 ------

或者更具体地说,这个模块的整个路径

请备注型号和颜色,会影响包名

package org.apache.spark.streaming.flume.sink;