Book Image

Learning Apache Flink

By : Tanmay Deshpande
Book Image

Learning Apache Flink

By: Tanmay Deshpande

Overview of this book

<p>With the advent of massive computer systems, organizations in different domains generate large amounts of data on a real-time basis. The latest entrant to big data processing, Apache Flink, is designed to process continuous streams of data at a lightning fast pace.</p> <p>This book will be your definitive guide to batch and stream data processing with Apache Flink. The book begins with introducing the Apache Flink ecosystem, setting it up and using the DataSet and DataStream API for processing batch and streaming datasets. Bringing the power of SQL to Flink, this book will then explore the Table API for querying and manipulating data. In the latter half of the book, readers will get to learn the remaining ecosystem of Apache Flink to achieve complex tasks such as event processing, machine learning, and graph processing. The final part of the book would consist of topics such as scaling Flink solutions, performance optimization and integrating Flink with other tools such as ElasticSearch.</p> <p>Whether you want to dive deeper into Apache Flink, or want to investigate how to get more out of this powerful technology, you’ll find everything you need inside.</p>
Table of Contents (17 chapters)
Learning Apache Flink
Credits
About the Author
About the Reviewers
www.PacktPub.com
Customer Feedback
Preface

Use case - Airport Travel Optimization


Let's consider a use case where we have data for the airports and the distance between them. In order to travel to certain destination from a particular airport, we have to find the shortest path between the two. Our airport data looks like as shown in the following table:

Id

Airport name

s01

A

s02

B

s03

C

s04

D

s05

E

The distance information between the airport looks like as shown in the following table:

From

To

Distance

s01

s02

10

s01

s02

12

s01

s03

22

s01

s04

21

s04

s11

22

s05

s15

21

s06

s17

21

s08

s09

11

s08

s09

12

Now let's use Gelly to find the Single Source Shortest Path.

Here we have options to choose among the three algorithms we learnt in previous section. In this example, we will use Vertex-Centric iterations method.

In order to solve the Single Source Shortest Path, we have to first load the data from CSV files as shown in the following code:

// set up the batch execution environment 
final ExecutionEnvironment...