JavaJava
Conference50min
INTERMEDIATE

Hunting with Stream Gatherers

The text discusses Java Streams, lauding their functionality for streamlined data processing, but noting their limitations. Previously, customization was limited and parallel streams were restricted to the ForkJoin pool, limiting their use in IO scenarios. However, Java 22 introduced Stream Gatherers, offering more flexibility for intermediate operations, enhancing performance and use cases.

Piotr Przybyl
Piotr PrzybylElastic

talkDetail.whenAndWhere

Thursday, October 10, 10:40-11:30
Room 8
talks.description
Streams were a very nice addition to Java 8, based on lambdas. They allow streamlined data processing without side effects, taking us gently towards functional style. With newer additions to Java, like records and pattern matching, they shine even more in data-driven flows.However, they don’t come without flaws.For starters, the only available extension point was collectors: if your needs for gathering data weren’t satisfied by the whole Collectors ZOO, you could always fall back to creating your own Collector. However, if map, filter or flatMap weren’t enough, you couldn’t add your own intermediate operation.Secondly, parallel streams were limited to ForkJoin pool, effectively rendering them unusable for scenarios involving any IO.Since Java 22, Stream Gatherers are our extension point for intermediate operations in streams.If you’d like to comprehend how they work, find nice use cases and hunt for more performance, this talk is for you.
Streams
Stream Gatherers
Java 8
Data processing
talks.speakers
Piotr Przybyl

Piotr Przybyl

Elastic

Poland

Notorious engineer at work and after hours, tracing meanders of the art of software engineering. Remote Software Gardener, mostly working in web-oriented Java gardens. Java Champion. Testcontainers Champion. Programming usually in Java, Scala and Go, but in other languages too. Fan of agility, seen mostly as choosing the right tools and approaches after asking the right questions. Developer, trainer and conference speaker. In his talks, Piotr covers not only hardcore Java but also software architecture, computer security, and soft-skills.
comments.title

comments.speakerNotEnabledComments