![](/img/trans.png)
[英]How to read a JSON file using Apache beam parDo function in Java
[英]ParDo function not waiting for Window in Apache BEAM
I've created a Window in Apache BEAM to wait either a window to expire or the window is too full (messages are unbounded and coming from a pub/sub queue):
.apply("Window", Window.<TraceUpdateMessage>into(new GlobalWindows())
.withTimestampCombiner(TimestampCombiner.EARLIEST)
.triggering(Repeatedly.forever(
AfterFirst.of(
AfterProcessingTime
.pastFirstElementInPane()
.plusDelayOf(Duration.standardMinutes(options.getFixedWindowDuration())),
AfterPane
.elementCountAtLeast(options.getFixedWindowElementCountTrigger())
)
))
.withAllowedLateness(Duration.ZERO)
.discardingFiredPanes()
)
在 window 之后,我有一個 ParDo:
.apply("Aggregate", ParDo.of(
new CustomAggregationFunction()
)
問題是CustomAggregationFunction
被立即調用,它看起來不像 window 正在做任何事情。 目標是 go 只有在CustomAggregationFunction
已滿並處理 window 中的所有元素時才調用 CustomAggregationFunction。
在任何分組轉換之前,窗口化不會生效。 在Window
和ParDo
之間插入分組轉換(例如按鍵分組或重新洗牌)應該可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.