Questions tagged [apache-flink]

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

Apache Flink

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

case class WordWithCount(word: String, count: Int)

val text = env.readTextFile(path)

val counts = text.flatMap { _.split("\\W+") }
  .map { WordWithCount(_, 1) }
  .groupBy("word")
  .sum("count")

counts.writeAsCsv(outputPath)

These are some of the unique features of Flink:

  • Hybrid batch/streaming runtime that supports batch processing and data streaming programs.
  • 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.

Learn more about Flink here.

Building Apache Flink from Source

Prerequisites for building Flink:

  • Unix-like environment (We use Linux, Mac OS X, Cygwin)
  • git
  • Maven (at least version 3.0.4)
  • 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)

Commands:

git clone https://github.com/apache/flink.git
cd flink
mvn clean package -DskipTests

Flink is now installed in build-target

Developing Flink

The Flink committers use IntelliJ IDEA and Eclipse IDE to develop the Flink codebase.

Minimal requirements for an IDE are:

  • Support for Java and Scala (also mixed projects)
  • Support for Maven with Java and Scala

IntelliJ IDEA

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

Check out our Setting up IntelliJ guide for details.

Eclipse Scala IDE

For Eclipse users, we recommend using Scala IDE 3.0.3, based on Eclipse Kepler. While this is a slightly older version, we found it to be the version that works most robustly for a complex project like Flink.

Further details, and a guide to newer Scala IDE versions can be found in the How to setup Eclipse docs.

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

  1. Download the Scala IDE (preferred) or install the plugin to Eclipse Kepler. See How to setup Eclipse for download links and instructions.
  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"). Note: If you do not have the jar file, you probably did not run the command line build.
  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.

Support

Don’t hesitate to ask!

Contact the developers and community on the mailing lists if you need any help.

Open an issue if you found a bug in Flink.

Documentation

The documentation of Apache Flink is located on the website: http://flink.apache.org or in the docs/ directory of the source code.

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. Contact us if you are looking for implementation tasks that fit your skills. This article describes how to contribute to Apache Flink.

About

Apache Flink is an open source project of The Apache Software Foundation (ASF). The Apache Flink project originated from the Stratosphere research project.

7452 questions
2
votes
1 answer

Flink writes SingleOutputStreamOperator to two files instead of one

I am trying flink for a project at work. I have reached the point where I process a stream by applying count windowing, etc. However, I noticed a peculiar behavior, which I cannot explain. It seems that a stream is processed by two threads, and the…
cmcaba
  • 115
  • 3
  • 13
2
votes
1 answer

Async I/O for DataSet in Apache Flink

What is the equivalent for async I/O on a DataSet in Flink ? For DataStream its basically AsyncDataStream. Doing a blocking call in the map function ? Are their any best practices ?
Jay
  • 45
  • 1
  • 4
2
votes
1 answer

Flink 1.2.0 jdbc read stream data from Mysql

I am trying to use Flink 2.1.0 to read streaming data from mysql log table, however, it only read once then it will stop the process. I would like it to contiune read if there is incoming data and print it. Following is my code public class Database…
zt1983811
  • 1,011
  • 3
  • 14
  • 34
2
votes
1 answer

How does Flink (Kafka source) manage offsets?

I am using Flink's FlinkKafkaConsumer09 and I wonder where are the offsets of the kafka consumer stored? I can't find them in Zookeeper nor in Kafka's offset topic. Also the kafka-consumer-offset tool can't find. Is this handled by Flink internally?
TobiSH
  • 2,833
  • 3
  • 23
  • 33
2
votes
0 answers

Flink JobManager disconnected to taskmanager

I use Flink cluster(Standalone) and it disconnects task manager from Job manager after few hours. I follows basic step of setup standalone cluster in flink.apache.org and I use 1 master node and 2 workers and they are Mac osx. only 1 worker is…
minsub ji
  • 21
  • 5
2
votes
1 answer

What is the non-deprecated way to give Type Hints to flink output streams?

I have been running into InvalidTypesExceptions in Flink, typically when customizing a generic SourceFunction. Here's an example which, when added to my StreamExecutionEnvironment, throws these exceptions at runtime: public class…
kov
  • 137
  • 2
  • 9
2
votes
1 answer

Flink CEP: How to check if next event didn't appear in given time window?

I'm trying to find out how to implement the following logic having stream of events: First event appear in given time window(30s) Second event that is related to the first one(by some property) didn't appear in given time window Generate new error…
jurek
  • 63
  • 7
2
votes
0 answers

Flink Streaming: window never finalised

I use a TumblingWindow with EventTime. Here is a simplified version of my program: final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setStreamTimeCharacteristic( TimeCharacteristic.EventTime…
Derlin
  • 9,572
  • 2
  • 32
  • 53
2
votes
0 answers

Is there a way to launch a beam job using the flink backend on yarn programmatically?

Is there a way to launch a beam job using the flink backend on yarn programmatically? Can FlinkPipelineOptions be configured to point to a yarn cluster?
Mark
  • 163
  • 7
2
votes
1 answer

sbt assembly plugin includes "provided" libraries and it's lineage

Here is my build.sbt resolvers ++= Seq("Apache Development Snapshot Repository" at "https://repository.apache.org/content/repositories/snapshots/", Resolver.mavenLocal) name := "flink-wiki-edits" version := "1.0" scalaVersion := "2.11.7" val…
Somasundaram Sekar
  • 5,244
  • 6
  • 43
  • 85
2
votes
3 answers

Flink with Kafka as a source

I am trying to read the data from kafka topic, in Flink streaming. I am trying to run the following example code which is there as an example on page APACHE Flink 1.1.3 Documentation: Apache kafka connector, import java.util.Properties; import…
kadsank
  • 311
  • 7
  • 20
2
votes
1 answer

Flink Streaming: Data stream that gets controlled by control stream

I have a question which is a variation of this question: Flink: how to store state and use in another stream? I have two streams: val ipStream: DataStream[IPAddress] = ??? val routeStream: DataStream[RoutingTable] = ??? I want to find out which…
Jonas Gröger
  • 1,558
  • 2
  • 21
  • 35
2
votes
2 answers

Flink Error: java.lang.ClassNotFoundException: org.apache.flink.shaded.calcite.com.google.common.base.Throwables

I am using Flink for streaming the data which is in the csv file. I want to put it into table format with certain schema. For this purpose I am using Flink-table_2.10-1.1.3.jar (Table api) but I got the errors: log4j:WARN No appenders could be found…
kadsank
  • 311
  • 7
  • 20
2
votes
2 answers

Flink error: java.lang.NoSuchMethodError: org.apache.flink.api.table.Table

I am trying to use table and sql api of the flink for a simple example where I read the string from file, convert it to Tuple2 and try to insert it into table. Here is my code. import org.apache.flink.api.common.functions.FlatMapFunction; import…
kadsank
  • 311
  • 7
  • 20
2
votes
1 answer

Flink Avro Parquet Writer in RollingSink

I have an issue when i'm trying to set an AvroParquetWriter in RollingSink, sink path and writer path seems to be in conflict flink version : 1.1.3 parquet-avro version : 1.8.1 error : [...] 12/14/2016 11:19:34 Source: Custom Source -> Sink:…
del
  • 51
  • 1
  • 6
1 2 3
99
100