Created
October 10, 2018 12:18
-
-
Save DennisAlund/8869e76ae77916e9d3482c0c9a66e616 to your computer and use it in GitHub Desktop.
Gist for article: https://medium.com/evenbit/aggregate-thousands-of-inputs-per-second-with-firebase-76111212b850
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline | |
.apply("Receive PubSub", PubsubIO.readMessagesWithAttributes().fromTopic(fromTopic)) | |
.apply("Transform to KeyValue", ParDo.of(new TransformPubSubMessage())) | |
.apply("Apply window of time", Window.into(FixedWindows.of(WINDOW_SIZE))) | |
.apply("Group by contestant", GroupByKey.create()) | |
.apply("Count votes", Combine.groupedValues(new CountFn())) | |
.apply("Transform to PubSub Message", ParDo.of(new MakePubSubPayload())) | |
.apply("Send PubSub", PubsubIO.writeMessages().to(toTopic)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment