Actor system(Akka) in Flink

一泌霍、概述

Flink's distributed execution consists of two important processes, master and worker. When a Flink program is executed, various processes take part in the execution, namely Job Manager, Task Manager, and Job Client.

image.png

Flink程序需要提交給Job Client。然后,Job Client將作業(yè)提交給Job Manager。Job Manager負(fù)責(zé)協(xié)調(diào)資源分配和作業(yè)執(zhí)行。它首先要做的是分配所需的資源洽腺。資源分配完成后,任務(wù)將提交給相應(yīng)的Task Manager覆旱。當(dāng)接收到任務(wù)時(shí)蘸朋, Task Manager啟動(dòng)一個(gè)線程以開始執(zhí)行。執(zhí)行到位時(shí)扣唱,Task Manager會(huì)繼續(xù)向Job Manager報(bào)告狀態(tài)更改藕坯⊥拍希可以有各種狀態(tài),例如開始執(zhí)行炼彪,正在進(jìn)行或已完成吐根。作業(yè)執(zhí)行完成后,結(jié)果將發(fā)送回客戶端辐马。

二拷橘、Job Manager

  • The master processes, also known as Job Managers, coordinate and manage the execution of the program. Their main responsibilities include scheduling tasks, managing checkpoints, failure recovery, and so on.
  • There can be many Masters running in parallel and sharing these responsibilities. This helps in achieving high availability. One of the masters needs to be the leader. If the leader node goes down, the master node (standby) will be elected as leader.
  • The Job Manager consists of the following important components:
    • 1、Actor system
    • 2喜爷、Scheduler
    • 3冗疮、Check pointing
  • Flink internally uses the Akka actor system for communication between the Job Managers and the Task Managers.

2.1: Actor system(參與者系統(tǒng))

  • An actor system is a container of actors with various roles. It provides services such as scheduling, configuration, logging, and so on. It also contains a thread pool from where all actors are initiated. All actors reside in a hierarchy. Each newly created actor would be assigned to a parent. Actors talk to each other using a messaging system. Each actor has its own mailbox from where it reads all the messages. If the actors are local, the messages are shared through shared memory but if the actors are remote then messages are passed thought RPC calls.

Actor system是具有各種角色的actor的容器。它提供諸如調(diào)度檩帐,配置术幔,日志記錄等服務(wù)。它還包含一個(gè)啟動(dòng)所有actor的線程池湃密。所有actors都位于層次結(jié)構(gòu)中诅挑。每個(gè)新創(chuàng)建的actor都將分配給父級(jí)。actor使用消息傳遞系統(tǒng)相互交談勾缭。每個(gè)actor都有自己的郵箱揍障,從中讀取所有郵件。如果actor是本地的俩由,則消息通過共享內(nèi)存共享毒嫡,但如果actor是遠(yuǎn)程的,則通過RPC調(diào)用傳遞消息幻梯。

  • Each parent is responsible for the supervision of its children. If any error happens with the children, the parent gets notified. If an actor can solve its own problem then it can restart its children. If it cannot solve the problem then it can escalate the issue to its own parent:

每位家長(zhǎng)負(fù)責(zé)監(jiān)督其子女兜畸。如果children發(fā)生任何錯(cuò)誤,父母會(huì)收到通知碘梢。如果actor可以解決自己的問題咬摇,那么它可以重新啟動(dòng)它的子節(jié)點(diǎn)。如果它無(wú)法解決問題煞躬,那么它可以將問題升級(jí)到自己的父級(jí):


Actor system in Flink
  • In Flink, an actor is a container having state and behavior. An actor's thread sequentially keeps on processing the messages it will receive in its mailbox. The state and the behavior are determined by the message it has received.

在Flink中肛鹏,actor是具有狀態(tài)和行為的容器。 actor的線程依次持續(xù)處理它將在其郵箱中接收的消息恩沛。其狀態(tài)和行為由它收到的消息決定在扰。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市雷客,隨后出現(xiàn)的幾起案子芒珠,更是在濱河造成了極大的恐慌,老刑警劉巖搅裙,帶你破解...
    沈念sama閱讀 206,126評(píng)論 6 481
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件皱卓,死亡現(xiàn)場(chǎng)離奇詭異裹芝,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)娜汁,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,254評(píng)論 2 382
  • 文/潘曉璐 我一進(jìn)店門嫂易,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人存炮,你說我怎么就攤上這事炬搭。” “怎么了穆桂?”我有些...
    開封第一講書人閱讀 152,445評(píng)論 0 341
  • 文/不壞的土叔 我叫張陵宫盔,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我享完,道長(zhǎng)灼芭,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 55,185評(píng)論 1 278
  • 正文 為了忘掉前任般又,我火速辦了婚禮彼绷,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘茴迁。我一直安慰自己寄悯,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,178評(píng)論 5 371
  • 文/花漫 我一把揭開白布堕义。 她就那樣靜靜地躺著猜旬,像睡著了一般。 火紅的嫁衣襯著肌膚如雪倦卖。 梳的紋絲不亂的頭發(fā)上洒擦,一...
    開封第一講書人閱讀 48,970評(píng)論 1 284
  • 那天,我揣著相機(jī)與錄音怕膛,去河邊找鬼熟嫩。 笑死,一個(gè)胖子當(dāng)著我的面吹牛褐捻,可吹牛的內(nèi)容都是我干的掸茅。 我是一名探鬼主播,決...
    沈念sama閱讀 38,276評(píng)論 3 399
  • 文/蒼蘭香墨 我猛地睜開眼柠逞,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼倦蚪!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起边苹,我...
    開封第一講書人閱讀 36,927評(píng)論 0 259
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎裁僧,沒想到半個(gè)月后个束,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體慕购,經(jīng)...
    沈念sama閱讀 43,400評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 35,883評(píng)論 2 323
  • 正文 我和宋清朗相戀三年茬底,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了沪悲。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 37,997評(píng)論 1 333
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡阱表,死狀恐怖殿如,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情最爬,我是刑警寧澤涉馁,帶...
    沈念sama閱讀 33,646評(píng)論 4 322
  • 正文 年R本政府宣布,位于F島的核電站爱致,受9級(jí)特大地震影響烤送,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜糠悯,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,213評(píng)論 3 307
  • 文/蒙蒙 一帮坚、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧互艾,春花似錦试和、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,204評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至局嘁,卻和暖如春溉箕,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背悦昵。 一陣腳步聲響...
    開封第一講書人閱讀 31,423評(píng)論 1 260
  • 我被黑心中介騙來泰國(guó)打工肴茄, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人但指。 一個(gè)月前我還...
    沈念sama閱讀 45,423評(píng)論 2 352
  • 正文 我出身青樓寡痰,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親棋凳。 傳聞我的和親對(duì)象是個(gè)殘疾皇子拦坠,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,722評(píng)論 2 345

推薦閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,292評(píng)論 0 10
  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    網(wǎng)事_79a3閱讀 11,722評(píng)論 2 19
  • 我就想知道會(huì)是怎樣的留言. 翻來覆去睡不著贞滨,打開微信翻來翻去的看著通訊錄里所有的聯(lián)系人 突然間發(fā)現(xiàn)其實(shí)自己...
    板栗妞閱讀 295評(píng)論 0 0
  • 奇怪的小三天,盯著手機(jī)電視,心里已然無(wú)感晓铆,可能是因?yàn)樗麑?duì)我一直就是冷冷的勺良,所以我并沒有特別想他或是想要聯(lián)系的沖動(dòng)吧...
    滅絕小妮閱讀 275評(píng)論 0 0
  • 森蝶老師『英閱會(huì)』 成長(zhǎng)的足跡 (2018.4.6-4.7)day6^day7 給大寶和二寶粗略做個(gè)計(jì)劃,但并不完...
    尐肚兜閱讀 234評(píng)論 0 0