flink源码编译(windows环境)
前言
最新开始捣鼓flink,fucking the code之前,编译是第一步。
编译环境
win7 java maven

编译步骤
https://ci.apache.org/projects/flink/flink-docs-release-1.6/start/building.html 官方文档搞起,如下:
Building Flink from Source
This page covers how to build Flink 1.6.1 from sources.
Build Flink
In order to build Flink you need the source code. Either download the source of a release or clone the git repository.
In addition you need Maven 3 and a JDK (Java Development Kit). Flink requires at least Java 8 to build.
NOTE: Maven 3.3.x can build Flink, but will not properly shade away certain dependencies. Maven 3.2.5 creates the libraries properly. To build unit tests use Java 8u51 or above to prevent failures in unit tests that use the PowerMock runner.
To clone from git, enter:
git clone https://github.com/apache/flink
The simplest way of building Flink is by running:
mvn clean install -DskipTests
This instructs Maven (mvn) to first remove all existing builds (clean) and then create a new Flink binary (install).
To speed up the build you can skip tests, QA plugins, and JavaDocs:
mvn clean install -DskipTests -Dfast
The default build adds a Flink-specific JAR for Hadoop 2, to allow using Flink with HDFS and YARN.
Dependency Shading
Flink shades away some of the libraries it uses, in order to avoid version clashes with user programs that use different versions of these libraries. Among the shaded libraries are Google Guava, Asm, Apache Curator, Apache HTTP Components, Netty, and others.
The dependency shading mechanism was recently changed in Maven and requires users to build Flink slightly differently, depending on their Maven version:
Maven 3.0.x, 3.1.x, and 3.2.x It is sufficient to call mvn clean install -DskipTests in the root directory of Flink code base.
Maven 3.3.x The build has to be done in two steps: First in the base directory, then in the distribution project:
mvn clean install -DskipTests
cd flink-dist
mvn clean install
Note: To check your Maven version, run mvn --version.
Hadoop Versions
Info Most users do not need to do this manually. The download page contains binary packages for common Hadoop versions.
Flink has dependencies to HDFS and YARN which are both dependencies from Apache Hadoop. There exist many different versions of Hadoop (from both the upstream project and the different Hadoop distributions). If you are using a wrong combination of versions, exceptions can occur.
Hadoop is only supported from version 2.4.0 upwards. You can also specify a specific Hadoop version to build against:
mvn clean install -DskipTests -Dhadoop.version=2.6.1
Vendor-specific Versions 指定hadoop发行商
To build Flink against a vendor specific Hadoop version, issue the following command:
mvn clean install -DskipTests -Pvendor-repos -Dhadoop.version=2.6.1-cdh5.0.0
The -Pvendor-repos activates a Maven build profile that includes the repositories of popular Hadoop vendors such as Cloudera, Hortonworks, or MapR.
官网给出的是指定cdh发行商的版本,这里我给出一个hdp发行商的版本
mvn clean install -DskipTests -Pvendor-repos -Dhadoop.version=2.7.3.2.6.1.114-2
详细的版本信息可以从http://repo.hortonworks.com/content/repositories/releases/org/apache/hadoop/hadoop-common/查看
Scala Versions
Info Users that purely use the Java APIs and libraries can ignore this section.
Flink has APIs, libraries, and runtime modules written in Scala. Users of the Scala API and libraries may have to match the Scala version of Flink with the Scala version of their projects (because Scala is not strictly backwards compatible).
Flink 1.4 currently builds only with Scala version 2.11.
We are working on supporting Scala 2.12, but certain breaking changes in Scala 2.12 make this a more involved effort. Please check out this JIRA issue for updates.
Encrypted File Systems
If your home directory is encrypted you might encounter a java.io.IOException: File name too long exception. Some encrypted file systems, like encfs used by Ubuntu, do not allow long filenames, which is the cause of this error.
The workaround is to add:
<args>
<arg>-Xmax-classfile-name</arg>
<arg>128</arg>
</args>
in the compiler configuration of the pom.xml file of the module causing the error. For example, if the error appears in the flink-yarn module, the above code should be added under the <configuration> tag of scala-maven-plugin. See this issue for more information.
编译结果


flink\flink-dist\target\flink-1.6.0-bin\flink-1.6.0下会有编译结果

flink源码编译(windows环境)的更多相关文章
- HBase-2.2.3源码编译-Windows版
源码环境一览 windows: 7 64Bit Java: 1.8.0_131 Maven:3.3.9 Git:2.24.0.windows.1 HBase:2.2.3 Hadoop:2.8.5 下载 ...
- 终于完成了 源码 编译lnmp环境
经过了大概一个星期的努力,终于按照海生的编译流程将lnmp环境源码安装出来了 nginx 和php 主要参考 http://hessian.cn/p/1273.html mysql 主要参考 http ...
- 查看android源码,windows环境下载源码
查看源码 参考: http://blog.csdn.net/janronehoo/article/details/8560304 步骤: 添加chrome插件 Android SDK Search 进 ...
- python在windows(双版本)及linux(源码编译)环境下安装
python下载 下载地址:https://www.python.org/downloads/ 可以下载需要的版本,这里选择2.7.12和3.6.2 下面第一个是linux版本,第二个是windows ...
- git在windows及linux(源码编译)环境下安装
git在windows下安装 下载地址:https://git-scm.com/ 默认安装即可 验证 git --version git在linux下安装 下载地址:https://mirrors.e ...
- TensorFlow Python2.7环境下的源码编译(一)环境准备
参考: https://blog.csdn.net/yhily2008/article/details/79967118 https://tensorflow.google.cn/install/in ...
- TensorFlow Python3.7环境下的源码编译(一)环境准备
参考: https://blog.csdn.net/yhily2008/article/details/79967118 https://tensorflow.google.cn/install/in ...
- vcmi(魔法门英雄无敌3 - 开源复刻版) 源码编译
vcmi源码编译 windows+cmake+mingw ##1 准备 HoMM3 gog.com CMake 官网 vcmi 源码 下载 QT5 with mingw 官网 Boost 源码1.55 ...
- 麒麟系统开发笔记(三):从Qt源码编译安装之编译安装Qt5.12
前言 上一篇,是使用Qt提供的安装包安装的,有些场景需要使用到从源码编译的Qt,所以本篇如何在银河麒麟系统V4上编译Qt5.12源码. 银河麒麟V4版本 系统版本: Qt源码下载 ...
随机推荐
- 记录几个经典的字符串hash算法
记录几个经典的字符串hash算法,方便以后查看: 推荐一篇文章: http://www.partow.net/programming/hashfunctions/# (1)暴雪字符串hash #inc ...
- Java 学习笔记 (三) Java 日期类型
以下内容摘自: https://www.cnblogs.com/crazylqy/p/4172324.html import java.sql.Timestamp; import java.text ...
- BZOJ_3477_[Usaco2014 Mar]Sabotage_二分答案
BZOJ_3477_[Usaco2014 Mar]Sabotage_二分答案 题意: 约翰的牧场里有 N 台机器,第 i 台机器的工作能力为 Ai.保罗阴谋破坏一些机器,使得约翰的工作效率变低.保罗可 ...
- 猴子 JDFZ模拟赛
猴子(弱) Description 话说NP做梦,梦见自己变成了一只猴子,并且有很多香蕉树,这些香蕉树都种在同一直线上,而NP则在这排香蕉树的第一棵树上.NP当然想吃尽量多的香蕉,但它又不想在地上走, ...
- Linux的文件类型
在Linux中,文件的颜色都是有含义的.其中, Linux中文件名颜色不同,代表文件类型不一样. 浅蓝色:表示链接文件: 灰色:表示其他文件: 绿色:表示可执行文件: 红色:表示压缩文件: 蓝色:表示 ...
- "unresolved reference 'appium' "问题解决
根据github的教程安装好"Appium-Python-Client"后,代码里写入"from appium import webdriver"就报错&quo ...
- Python中的turtle初探
turtle Python自带了一个turtle库,就像名字turtle说的那样,你可以创建一个turtle,然后这个turtle可以前进,后退,左转,这个turtle有一条尾巴,能够放下和抬起,当尾 ...
- PCB泪滴设计
操作:选择[Tools]-->[Teardrops],快捷键T+E.打开[Teardrop Options]对话框进行设置.如下图所示: 对话框面板介绍 [General] 1.该区域的[Pad ...
- appium在android 7.0真机上运行报错command failed shell:............ps:'uiautomator"的解决方式
appium版本:1_4_16 在CSDN中找到相关解决的方案,根据此解决方案顺利的解决了让人惆怅的问题,再次记录. 1.找到appium安装目录下的adb.js文件,目录为:Appium\node_ ...
- CountDownLatch和CyclicBarrier 区别
CountDownLatch : 一个线程(或者多个), 等待另外N个线程完成某个事情之后才能执行. CyclicBarrier : N个线程相互等待,任何一个线程完成之前,所有的线程都 ...