Skip to content

Instantly share code, notes, and snippets.

@brachi-wernick
Created November 20, 2018 20:20
Show Gist options
  • Save brachi-wernick/0e96c087c2226b8ebb5dd477f89916f3 to your computer and use it in GitHub Desktop.
Save brachi-wernick/0e96c087c2226b8ebb5dd477f89916f3 to your computer and use it in GitHub Desktop.
buildRecord.java
counts.mapValues((windowed, counter) ->
{
try {
return buildRecord(new LoginAttackCount(
windowed.key(),
counter,
windowed.window().start(),
windowed.window().end()));
} catch (IOException e) {
throw new RuntimeException(e);
}
})
.toStream()
.selectKey((k, v) -> k.toString())
.to(TOPIC, Produced.with(stringSerde, genericAvroSerde));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment