Skip to content

Instantly share code, notes, and snippets.

@vvcephei
Created March 6, 2019 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vvcephei/99108713ae84e9cb7287d1311e15345b to your computer and use it in GitHub Desktop.
Save vvcephei/99108713ae84e9cb7287d1311e15345b to your computer and use it in GitHub Desktop.
Suppression Blog Figure 3
events
.groupByKey()
.windowedBy(
TimeWindows.of(Duration.ofMinutes(2).withGrace(Duration.ofMinutes(2))
)
.count(Materialized.as("count-metric"))
.suppress(Suppressed.untilWindowClose(BufferConfig.unbounded()))
.filter( _ < 4 )
.toStream()
.foreach( /* Send that email! */)
// graph servelet queries "count-metric"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment