工作中用到了apache-spark,想深入了解一下,決定從源碼開始。
先導入到常用的ide,eclipse吧:
准備工作
1. 下載Eclipse:http://scala-ide.org/
2. 從github上下載源碼:https://github.com/apache/spark
第一個實驗品是Spark-Core項目
1. exist maven project 導入Eclipse
2. Eclipse自動導入依賴,這個過程時間較長,請等待
完成后,發現報錯:
spark build path is cross-compiled with an incompatible version of Scala (2.10.0)。。。
原因:版本不一致
- Scala IDE uses Scala 2.11.7
- Apache Spark built with Scala 2.10
解決方法:
選中scala libary container [2.11.7],點擊右鍵,選中屬性--->classpath container -->2.10 bundle.
此時重新編譯,編譯完成ok,沒有報錯。
參考文獻:
【1】https://cwiki.apache.org/confluence/display/SPARK/Useful+Developer+Tools#UsefulDeveloperTools-IDESetup
【2】http://stackoverflow.com/questions/34507966/spark-build-path-is-cross-compiled-with-an-incompatible-version-of-scala-2-10-0
【3】http://blog.csdn.net/yunlong34574/article/details/39213503