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.
- 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
- Import streaming ...