Skip to content

zartstrom/flink_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Some basic and complete examples of flink stream applications. Complete in the sense that:

  • build.sbt contains all the necessary dependencies,
  • imports are set correctly and
  • code compiles.

All examples are modifications of the basic WordCount example on flink's quickstart page.

Distinct Word Count

In DistinctWordCount.scala we count distinct words in a time window via a window function.

class DistinctCountWindowFunction extends WindowFunction[WordWithCount, String, String, TimeWindow]

Top N in Window

In TopNWindow.scala we count occurrences of words and calculate the top n words by count in a time window.

Kafka source

KafkaSourceTest.scala fetches data from a kafka topic using a flink kafka consumer.

new FlinkKafkaConsumer010[String]("raw", new SimpleStringSchema(), properties))

About

Basic flink examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages