【发布时间】:2018-08-28 08:07:17
【问题描述】:
我使用 Google Cloud PubSub 和 Dataflow 来处理我的数据。我想检测我的日常流程何时完成,换句话说,当窗口会话完成/达到间隙持续时间时。对于这种情况,是否有一个可以触发的触发器?如果没有,有没有我可以使用的解决方法?
Pipeline p = Pipeline.create(options);
p.apply("ReadPubSubMessage", PubsubIO.readMessages().fromSubscription("projects/project-id/subscriptions/my-sub"))
.apply("ApplyTimestamps", WithTimestamps.of((PubsubMessage pubSub) -> new Instant(System.currentTimeMillis())))
.apply("SessionWindowing", Window.<PubsubMessage>into(Sessions.withGapDuration(Duration.standardMinutes(10)))
.triggering(?)
.withAllowedLateness(Duration.standardSeconds(30))
.discardingFiredPanes())
.apply(new CountWords())
抱歉,如果我遗漏了文档中的一些明显内容。
【问题讨论】:
标签: google-cloud-dataflow apache-beam google-cloud-pubsub