Skip to content

Instantly share code, notes, and snippets.

@enothereska
Last active June 20, 2017 05:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enothereska/019b305c4d91d229a20a280dccd9bcbc to your computer and use it in GitHub Desktop.
Save enothereska/019b305c4d91d229a20a280dccd9bcbc to your computer and use it in GitHub Desktop.
A KTable example
KTable<Windowed<String>, Long> aggregated = inputStream
.groupByKey()
.reduce((aggValue, newValue) -> aggValue + newValue,
TimeWindows.of(TimeUnit.MINUTES.toMillis(2))
.until(TimeUnit.DAYS.toMillis(1) /* keep for one day */),
"queryStoreName");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment