SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
Apache Flink 둘러보기
이문수
NFLabs
moon@nflabs.com
Spark 사용자를 위한
Apache Flink
Streaming dataflow 엔진을 기반으로 한
스트리밍 & 배치 프로세싱 플랫폼
Flink 구성 요소를 살펴보면
Python
Spark 과 비슷
Flink Spark
Data DataSet RDD
DataFrame Table DataFrame
Machine Learning Flink ML MLlib
Graph Gelly Graphx
SQL - SparkSQL
Streaming DataStream SparkStreaming
비교해보면
DataSet
DataSet Spark 의 RDD에 해당
은 RDD 변환하고, 변환이 끝나면 또 변환하고, 이
과정을 반복
RDD Operator RDD Operator ….
Operator Operator Operator
Data
Source
는 Operator 들 사이로 데이터를 흘려보냄
RDD
Data
Sink
-> Data centric
-> Operator centric
Iteration
Operator Operator Operator
Data
Source
Data
Sink
Operator
Spark 처럼 Operator 와 RDD 를 끊임없이 생성하지 않고 수행가능
10000
Fault Tolerance
Spark 은 Lineage 을 이용해 전체 과정을 다시 계산
(persistance 된 RDD 가 있으면 그 이후로 계산)
RDD Operator RDD Operator ….
Operator Operator Operator
Data
Source
Flink 는 마지막 checkpoint 이후로 DataSource 에서 Replay
RDD
Data
Sink
X
X
Checkpoint
Operator Operator
Data
Source
Data
Sink
barrier barrier
안전한 데이터다시 계산될
수도 있는 데이터
1. 레코드 개별이 아니고, 어느정도 레
코드 묶음단위로 Data source 에서
data stream 중간에 barrier 을 끼워
넣는다
2. Data sink 에 barrier 가 도착하면
해당 부분까지 계산이 완료 된것으로
본다.
3. Sink 에서는 Source 에 barrier 도착을 알
려 Source 에서 필요없는 데이터를 지우도록
한다.
DataSet API
DataSet 을 만들 때
val text = env.readTextFile("file:///path/to/file")
val text = env.fromElements(“hello”, “world”)
val data = env.createInput(InputFormat<X, ?> inputFormat)
메모리에 있는 collection으로 부터 생성하거나
val env = ExecutionEnvironment.getExecutionEnvironment
SparkContext 에 해당하는 ExecutionEnvironment 를 통해 만들 수 있다.
파일로 부터 생성하거나
사용자가 지정한 InputFormt 으로부터
DataSet 을 저장 할때
data.output(OutputFormat<T> outputFormat)
val text = data.writeAsText(“file:///…”)
파일로 저장하거나
사용자가 지정한 OutputFormat 으로 내보내거나
data.print()
화면에 뿌리거나
Transformations
map
flatMap
mapPartition
filter
reduce
reduceGroup
aggregate
join
coGroup
cross
union
hashPartition
sortPartition
val text = env.fromElements(
"Who's there?",
"I think I hear them. Stand, ho! Who's
there?”)
val counts = text
.flatMap {_.toLowerCase.split("W+") }
.map { (_, 1) }
.groupBy(0)
.sum(1)
DataStream API
DataStream 을 만들 때
val dataStream = env.readFileStream(String path, long
checkFrequencyMillis, WatchType watchType)
val dataStream = env.socketTextStream(“localhost”, “9999”)
val dataStream = env.addSource(sourceFunction)
소켓으로 부터 생성하거나
val env = StreamExecutionEnvironment.getExecutionEnvironment
SparkContext 에 해당하는 ExecutionEnvironment 를 통해 만들 수 있다.
디렉토리에 추가/변경되는 파일을 모니터링
사용자가 지정한 Source 으로부터
Kafka, RabbitMQ, Flume
DataStream 을 저장 할 때
dataStream.writeAsText(parameters)
dataStream.addSink(sinkFunction)
파일로 저장하거나
사용자가 구현한 Sink를 사용
dataStream.print()
화면에 뿌리거나
Windowing
policy
• Count
• Time
• Delta
DataStream API 예
Table API
Spark, R 의 DataFrame, Python 의
Pandas 와 비슷한 API 제공
import org.apache.flink.api.scala._
import org.apache.flink.api.scala.table._
case class WC(word: String, count: Int)
val input = env.fromElements(WC("hello", 1), WC("hello", 1), WC("ciao", 1))
val expr = input.toTable
val result = expr.groupBy('word).select('word, 'count.sum as 'count).toSet[WC]
Memory Management
val counts = text
.flatMap {_.toLowerCase.split("W+") }
.map { (_, 1) }
.groupBy(0)
.sum(1)
Spark에서는 Tungsten 으로
이제하려고 시도하는 것
Architecture
감사합니다
이문수
http://zeppelin.incubator.apache.org
moon@apache.org

Contenu connexe

Tendances

Best Practices for Enabling Speculative Execution on Large Scale Platforms
Best Practices for Enabling Speculative Execution on Large Scale PlatformsBest Practices for Enabling Speculative Execution on Large Scale Platforms
Best Practices for Enabling Speculative Execution on Large Scale Platforms
Databricks
 

Tendances (20)

A Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and HudiA Thorough Comparison of Delta Lake, Iceberg and Hudi
A Thorough Comparison of Delta Lake, Iceberg and Hudi
 
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
OSMC 2022 | Ignite: Observability with Grafana & Prometheus for Kafka on Kube...
 
Apache Kafka 0.8 basic training - Verisign
Apache Kafka 0.8 basic training - VerisignApache Kafka 0.8 basic training - Verisign
Apache Kafka 0.8 basic training - Verisign
 
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
 
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
 
Processing Semantically-Ordered Streams in Financial Services
Processing Semantically-Ordered Streams in Financial ServicesProcessing Semantically-Ordered Streams in Financial Services
Processing Semantically-Ordered Streams in Financial Services
 
Delta Lake with Azure Databricks
Delta Lake with Azure DatabricksDelta Lake with Azure Databricks
Delta Lake with Azure Databricks
 
Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic Datasets
 
Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0Native Support of Prometheus Monitoring in Apache Spark 3.0
Native Support of Prometheus Monitoring in Apache Spark 3.0
 
Data Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
Data Engineer's Lunch #83: Strategies for Migration to Apache IcebergData Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
Data Engineer's Lunch #83: Strategies for Migration to Apache Iceberg
 
Alfresco tuning part1
Alfresco tuning part1Alfresco tuning part1
Alfresco tuning part1
 
Apache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper OptimizationApache Spark Core—Deep Dive—Proper Optimization
Apache Spark Core—Deep Dive—Proper Optimization
 
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a ServiceZeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
Zeus: Uber’s Highly Scalable and Distributed Shuffle as a Service
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Deep dive into flink interval join
Deep dive into flink interval joinDeep dive into flink interval join
Deep dive into flink interval join
 
Changelog Stream Processing with Apache Flink
Changelog Stream Processing with Apache FlinkChangelog Stream Processing with Apache Flink
Changelog Stream Processing with Apache Flink
 
Cosco: An Efficient Facebook-Scale Shuffle Service
Cosco: An Efficient Facebook-Scale Shuffle ServiceCosco: An Efficient Facebook-Scale Shuffle Service
Cosco: An Efficient Facebook-Scale Shuffle Service
 
Accelerating Data Ingestion with Databricks Autoloader
Accelerating Data Ingestion with Databricks AutoloaderAccelerating Data Ingestion with Databricks Autoloader
Accelerating Data Ingestion with Databricks Autoloader
 
Best Practices for Enabling Speculative Execution on Large Scale Platforms
Best Practices for Enabling Speculative Execution on Large Scale PlatformsBest Practices for Enabling Speculative Execution on Large Scale Platforms
Best Practices for Enabling Speculative Execution on Large Scale Platforms
 
Confluent와 함께 Data in Motion 실현
Confluent와 함께 Data in Motion 실현Confluent와 함께 Data in Motion 실현
Confluent와 함께 Data in Motion 실현
 

Similaire à 스사모 테크톡 - Apache Flink 둘러보기

2006 03 15_pe & api hook
2006 03 15_pe & api hook2006 03 15_pe & api hook
2006 03 15_pe & api hook
용환 노
 
SpringCamp 2013 : About Jdk8
SpringCamp 2013 : About Jdk8SpringCamp 2013 : About Jdk8
SpringCamp 2013 : About Jdk8
Sangmin Lee
 
[1A5]효율적인안드로이드앱개발
[1A5]효율적인안드로이드앱개발[1A5]효율적인안드로이드앱개발
[1A5]효율적인안드로이드앱개발
NAVER D2
 
하둡 타입과 포맷
하둡 타입과 포맷하둡 타입과 포맷
하둡 타입과 포맷
진호 박
 

Similaire à 스사모 테크톡 - Apache Flink 둘러보기 (20)

Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018
 Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018 Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018
Terraform을 이용한 Infrastructure as Code 실전 구성하기 :: 변정훈::AWS Summit Seoul 2018
 
Terraform을 이용한 Infrastructure as Code 실전 구성하기
Terraform을 이용한 Infrastructure as Code 실전 구성하기Terraform을 이용한 Infrastructure as Code 실전 구성하기
Terraform을 이용한 Infrastructure as Code 실전 구성하기
 
Spark 소개 2부
Spark 소개 2부Spark 소개 2부
Spark 소개 2부
 
Python
PythonPython
Python
 
Spark sql
Spark sqlSpark sql
Spark sql
 
Java advancd ed10
Java advancd ed10Java advancd ed10
Java advancd ed10
 
learning spark - Chatper8. Tuning and Debugging
learning spark - Chatper8. Tuning and Debugginglearning spark - Chatper8. Tuning and Debugging
learning spark - Chatper8. Tuning and Debugging
 
2006 03 15_pe & api hook
2006 03 15_pe & api hook2006 03 15_pe & api hook
2006 03 15_pe & api hook
 
스프링군살없이세팅하기(The way to setting the Spring framework for web.)
스프링군살없이세팅하기(The way to setting the Spring framework for web.)스프링군살없이세팅하기(The way to setting the Spring framework for web.)
스프링군살없이세팅하기(The way to setting the Spring framework for web.)
 
함수적 사고 2장
함수적 사고 2장함수적 사고 2장
함수적 사고 2장
 
웹 사이트 시각화 및 성능 관리
웹 사이트 시각화 및 성능 관리웹 사이트 시각화 및 성능 관리
웹 사이트 시각화 및 성능 관리
 
Pair RDD - Spark
Pair RDD - SparkPair RDD - Spark
Pair RDD - Spark
 
Ji 개발 리뷰 (신림프로그래머)
Ji 개발 리뷰 (신림프로그래머)Ji 개발 리뷰 (신림프로그래머)
Ji 개발 리뷰 (신림프로그래머)
 
SpringCamp 2013 : About Jdk8
SpringCamp 2013 : About Jdk8SpringCamp 2013 : About Jdk8
SpringCamp 2013 : About Jdk8
 
Scala for play
Scala for playScala for play
Scala for play
 
R 프로그램의 이해와 활용 v1.1
R 프로그램의 이해와 활용 v1.1R 프로그램의 이해와 활용 v1.1
R 프로그램의 이해와 활용 v1.1
 
[1A5]효율적인안드로이드앱개발
[1A5]효율적인안드로이드앱개발[1A5]효율적인안드로이드앱개발
[1A5]효율적인안드로이드앱개발
 
하둡 타입과 포맷
하둡 타입과 포맷하둡 타입과 포맷
하둡 타입과 포맷
 
SPARK SQL
SPARK SQLSPARK SQL
SPARK SQL
 
Open vSwitch의 Vendor Extension 구현
Open vSwitch의 Vendor Extension 구현Open vSwitch의 Vendor Extension 구현
Open vSwitch의 Vendor Extension 구현
 

스사모 테크톡 - Apache Flink 둘러보기