溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Flink核心概念是什么

發(fā)布時間:2021-11-16 16:48:32 來源:億速云 閱讀:122 作者:iii 欄目:大數(shù)據(jù)

這篇文章主要介紹“Flink核心概念是什么”,在日常操作中,相信很多人在Flink核心概念是什么問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”Flink核心概念是什么”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

    Flink程序是在分布式集合上實(shí)現(xiàn)轉(zhuǎn)換的常規(guī)程序(例如filtering, mapping, updating state, joining, grouping, defining windows, aggregating)。集合最初是從sources上創(chuàng)建,這些源包括:本地文件, kafka topics, 內(nèi)存集合等。結(jié)果通過sink返回,sink可以將數(shù)據(jù)寫入文件中(分布式)或者終端輸出(命令行)。Flink可以運(yùn)行在不同環(huán)境下,例如可以嵌入到其他程序中運(yùn)行,也可以在單機(jī)運(yùn)行,此外Flink可以在本地JVM中運(yùn)行,也可以在分布式集群中運(yùn)行。

    有有界數(shù)據(jù)源也有無界數(shù)據(jù)源,可以使用批處理和流處理,使用批處理時使用DataSet API ,使用流處理時使用DataStream API。

Flink編程模型

第一步:獲取執(zhí)行環(huán)境,批處理與流處理不同

第二步:獲取數(shù)據(jù),socket、文本、kafka

第三步:transform

第四步:sink 到哪里去

第五步:觸發(fā)執(zhí)行。

Lazy Evaluation 延遲執(zhí)行

All Flink programs are executed lazily: When the program’s main method is executed, the data loading and transformations do not happen directly. Rather, each operation is created and added to the program’s plan. The operations are actually executed when the execution is explicitly triggered by an execute() call on the execution environment. Whether the program is executed locally or on a cluster depends on the type of execution environment.
The lazy evaluation lets you construct sophisticated programs that Flink executes as one holistically planned unit.

 上面的意思是說:當(dāng)主函數(shù)被執(zhí)行時,數(shù)據(jù)加載和transformation不會馬上執(zhí)行。每一個操作會被添加到程序的執(zhí)行計劃中,相當(dāng)于僅僅是記下來了。當(dāng)這些"執(zhí)行操作"被顯式觸發(fā)時(例如調(diào)用execute()時),才會真正執(zhí)行操作。

這種延遲執(zhí)行方式可以讓我們構(gòu)建非常復(fù)雜的應(yīng)用程序,F(xiàn)link將一些執(zhí)行操作作為整體去執(zhí)行。方便我們?nèi)?yōu)化。

到此,關(guān)于“Flink核心概念是什么”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注億速云網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI