O'Reilly logo

Java 9 Concurrency Cookbook - Second Edition by Javier Fernández González

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reducing the elements of a stream

MapReduce is a programming model used to process very large datasets in distributed environments using a lot of machines working in a cluster. This programming model has the following two operations:

  • Map: This operation filters and transforms the original elements into a form more suitable to the reduction operation
  • Reduce: This operation generates a summary result from all the elements, for example, the sum or the average of numeric values

This programming model has been commonly used in the functional programming world. In the Java ecosystem, the Hadoop project of the Apache Software Foundation provides an implementation of this model. The Stream class implements two different reduce operations:

  • The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required