0
我打算使用谷歌的数据流,以协调人在半实物形式完成,3种形式已经完成后的冲突检测。我已经安装谷歌PubSub的两个数据流源和宿,并希望只是有触发火灾后已收到上JobId
三种形式发送到PubSub的水槽。elementCountAtLeast之前谷歌的数据流触发器触发达到
This SO post看起来类似于我试图解决这个问题,但是当我实现它,扳机发射,并达到AfterPane.elementCountAtLeast之前发送输出到PubSub的水槽。
我已经与GlobalWindow
和SlidingWindow
试过了它。一旦我得到的触发因素elementCountAtLeast
火灾后到达,我打算为jobId
实施GroupByKey
。但是,在我转移到这一步之前,我想让elementCountAtLeast
独立工作。
这里是从PubSub的阅读和代码SlidingWindow
:被触发
PCollection<String> humanInTheLoopInput;
humanInTheLoopInput = pipeline
.apply(PubsubIO.Read
.named("ReadFromHumanInTheLoopSubscription")
.subscription(options.getInputHumanInTheLoopRawSubscription()));
PCollection<String> windowedInput = humanInTheLoopInput
.apply(Window
.<String>into(SlidingWindows
.of(Duration.standardSeconds(30))
.every(Duration.standardSeconds(5)))
.<String>triggering(Repeatedly.forever(AfterPane.elementCountAtLeast(3)))
.discardingFiredPanes()
.withAllowedLateness(Duration.standardDays(10)));