Running example

Flink provides a streaming API called Flink DataStream API to process continuous unbounded streams of data in realtime.

To start using Datastream API, you should add the following dependency to the project. Here, we are using sbt for build management.

org.apache.Flink" %% "Flink-scala" % "1.0.0 

In the next few steps, we will create a word count program which reads from a socket and displays the word count in realtime.

  1. Get the Streaming environment: First of all we have to create the streaming environment on which the program runs. We will discuss deployment modes later in this chapter:
val environment = StreamExecutionEnvironment.getExecutionEnvironment 
StreamExecutionEnvironment is similar to spark context.
  1. Import streaming ...

Get Practical Real-time Data Processing and Analytics now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.