README.md 4.6 KB
Newer Older
1
# Apache Flink
2

3
Apache Flink is an open source platform for scalable batch and stream data processing. Flink supports batch and streaming analytics,
4
in one system. Analytical programs can be written in concise and elegant APIs in Java and Scala.
5

6 7
```scala
case class WordWithCount(word: String, count: Int)
8

9
val text = env.readTextFile(path)
10

11 12 13 14 15 16 17 18 19 20 21
val counts = text.flatMap { _.split("\\W+") }
  .map { WordWithCount(_, 1) }
  .groupBy("word")
  .sum("count")

counts.writeAsCsv(outputPath)
```

Flink is highlighted by some unique features:

* Hybrid batch/streaming runtime that supports batch processing and data streaming programs.
22 23 24 25
* Custom memory management to guarantee efficient, adaptive, and highly robust switching between in-memory and out-of-core data processing algorithms.
* Flexible and expressive windowing semantics for data stream programs.
* Built-in program optimizer that chooses the proper runtime operations for each program.
* Custom type analysis and serialization stack for high performance.
R
Robert Metzger 已提交
26 27


28
Learn more about Flink at [http://flink.apache.org/](http://flink.apache.org/)
29 30


31
## Building Apache Flink from Source
32

R
Robert Metzger 已提交
33
* Unix-like environment (We use Linux, Mac OS X, Cygwin)
34
* git
R
Robert Metzger 已提交
35
* Maven (at least version 3.0.4)
36
* Java 6, 7 or 8 (Note that Oracle's JDK 6 library will fail to build Flink, but is able to run a pre-compiled package without problem)
37

R
Robert Metzger 已提交
38
```
39 40
git clone https://github.com/apache/flink.git
cd flink
41
mvn clean package -DskipTests # this will take up to 5 minutes
R
Robert Metzger 已提交
42
```
43

44
Flink is now installed in `build-target`
45 46


47 48
## Developing Flink

49
The Flink committers use IntelliJ IDEA and Eclipse IDE to develop the Flink codebase.
50 51 52 53 54 55

Minimal requirements for an IDE are:
* Support for Java and Scala (also mixed projects)
* Support for Maven with Java and Scala


56
### IntelliJ IDEA
57 58 59 60 61 62

The IntelliJ IDE supports Maven out of the box and offers a plugin for Scala development.

* IntelliJ download: [https://www.jetbrains.com/idea/](https://www.jetbrains.com/idea/)
* IntelliJ Scala Plugin: [http://plugins.jetbrains.com/plugin/?id=1347](http://plugins.jetbrains.com/plugin/?id=1347)

63
Check out our [Setting up IntelliJ](https://github.com/apache/flink/blob/master/docs/internals/ide_setup.md#intellij-idea) guide for details.
64

65 66
### Eclipse Scala IDE

67
For Eclipse users, we recommend using Scala IDE 3.0.3, based on Eclipse Kepler. While this is a slightly older version,
U
Ufuk Celebi 已提交
68
we found it to be the version that works most robustly for a complex project like Flink.
69 70

Further details, and a guide to newer Scala IDE versions can be found in the
71
[How to setup Eclipse](https://github.com/apache/flink/blob/master/docs/internals/ide_setup.md#eclipse) docs.
72 73

**Note:** Before following this setup, make sure to run the build from the command line once
74
(`mvn clean install -DskipTests`, see above)
75

76
1. Download the Scala IDE (preferred) or install the plugin to Eclipse Kepler. See 
77
   [How to setup Eclipse](https://github.com/apache/flink/blob/master/docs/internals/ide_setup.md#eclipse) for download links and instructions.
78 79 80
2. Add the "macroparadise" compiler plugin to the Scala compiler.
   Open "Window" -> "Preferences" -> "Scala" -> "Compiler" -> "Advanced" and put into the "Xplugin" field the path to
   the *macroparadise* jar file (typically "/home/*-your-user-*/.m2/repository/org/scalamacros/paradise_2.10.4/2.0.1/paradise_2.10.4-2.0.1.jar").
U
Ufuk Celebi 已提交
81
   Note: If you do not have the jar file, you probably did not run the command line build.
82 83 84 85
3. Import the Flink Maven projects ("File" -> "Import" -> "Maven" -> "Existing Maven Projects") 
4. During the import, Eclipse will ask to automatically install additional Maven build helper plugins.
5. Close the "flink-java8" project. Since Eclipse Kepler does not support Java 8, you cannot develop this project.

86 87

## Support
88

89 90
Don’t hesitate to ask!

91
Contact the developers and community on the [mailing lists](http://flink.apache.org/community.html#mailing-lists) if you need any help.
92

93
[Open an issue](https://issues.apache.org/jira/browse/FLINK) if you found a bug in Flink.
94 95


96
## Documentation
97

98
The documentation of Apache Flink is located on the website: [http://flink.apache.org](http://flink.apache.org)
99
or in the `docs/` directory of the source code.
100

101 102 103 104

## Fork and Contribute

This is an active open-source project. We are always open to people who want to use the system or contribute to it. 
R
Robert Metzger 已提交
105
Contact us if you are looking for implementation tasks that fit your skills.
106
This article describes [how to contribute to Apache Flink](http://flink.apache.org/how-to-contribute.html).
107 108


R
Robert Metzger 已提交
109
## About
110

111
Apache Flink is an open source project of The Apache Software Foundation (ASF).
112
The Apache Flink project originated from the [Stratosphere](http://stratosphere.eu) research project.
113