簡體   English   中英

合並多個 flink 作業的 output 並返回單個 output

[英]Merge output of multiple flink jobs and return single output

我有多個 flink 作業,它們具有相同的輸入 kafka 主題來源,並且 output 格式也相同。

來源 -> flink 作業 1 -> output
來源 -> flink 作業 2 -> output
來源 -> flink 作業 3 -> output
來源 -> flink 作業 4 -> output
.
.
.
來源 -> flink 作業 n -> output

output 格式類似於Object(pk: String, variable1: String, variable2: Boolean)

我想消耗所有 output 並組合 output 讓我們說 Z78E6221F6393D14CE6DZ 數組的 json

最終需要 output (pk: String, variable1: List[String], variable2: List[Boolean])

PS - 根據實現的 flink 作業邏輯,某些 flink 作業可能不會返回 output 用於輸入,我使用 scala 作為語言

我設法通過創建另一個作為主作業的 flink 作業來解決這個問題。 該作業的輸入是其他 N 個作業的 output。 因為,這些作業具有filter(condition) ,所以我添加了一個帶有filter(!condition)的數據流,以確保每個作業都返回 output。 此外,在主作業中添加了一個數據流,用於維護總作業數並將其與主作業數據流connected 相同的表示在下圖中。 溶液流動

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM