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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.