O'Reilly logo
live online training icon Live Online training

Scalable Programming with Java 8 Parallel Streams

Douglas Schmidt

Attendees in this course will learn how to develop efficient parallel programs that run scalably on multi-core processors using powerful object-oriented and functional programming language features and frameworks defined by Java 8. In particular, this training focuses on how Java 8 leverages its functional programming features to create parallel streams, which are a powerful framework that provides a straightforward and scalable means to partition a stream of data elements into multiple substreams that can run in one or more processor cores and combine the output into a so-called "reduced" result.

This course assumes working knowledge of Java 8 Lambdas and Streams. We recommend taking the first course in this series if you require that training.

Course series:

Programming with Java 8 Lambdas and Streams – Java 8 Concurrency Series, Part 1
Scalable Programming with the Java 8 Parallel Streams – Java 8 Concurrency Series, Part 2
Reactive Programming with the Java 8 Completable Futures – Java 8 Concurrency Series, Part 3

What you'll learn-and how you can apply it

  • Develop efficient parallel programs using powerful Java 8 object-oriented and functional programming language features and frameworks.
  • Recognize the inherent and accidental complexities involved with developing parallel software for Java 8 clients and servers.
  • Understand how common software patterns and Java 8 parallel programming mechanisms can and cannot help to alleviate this complexity.
  • Know where to find additional sources of information on how to successfully develop robust parallel programs in Java 8.

This training course is for you because...

  • For software developers creating scalable apps on modern multi-core processors in Java.

Prerequisites

This training is intended for software developers who are familiar with:

  • General object-oriented design and programming concepts, such as encapsulation, abstraction, polymorphism, extensibility, and the Unified Modeling Language (UML),
  • Core object-oriented programming language features, such as classes, inheritance, dynamic binding, and generics, that are available in Java,
  • Core functional programming features, such as lambda expressions, method references, and functional interfaces, that are available in Java 8, and
  • Core Java 8 sequential streams features, such as intermediate operations (e.g., map(), filter(), and flatMap()) and terminal operations (e.g., collect() and reduce())
  • Core functional programming features and Java 8 sequential streams are covered in another Live Training course entitled Programming with Java 8 Lambdas and Streams
  • Need to know how to download and install the Java 8 JDK and JRE
  • Need to know how to download and install an IDE, such as IntelliJ, NetBeans, Eclipse, or Android Studio

Materials, downloads, or Supplemental Content needed in advance:

An installed copy of the Java 8 JDK and JRE

An installed copy of IntelliJ, NetBeans, Eclipse, or Android Studio

Resources:

LiveLessons: Java Concurrency (2nd edition) (video)

LiveLessons: Design Patterns in Java (video)

About your instructor

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Segment 1 Overview of Java 8 Parallel Streams (20mins)

  • Instructor will explain the key concepts and programming elements in Java 8 parallel streams, focusing on how it is often straightforward to convert a sequential stream to a parallel stream.
  • Participants will understand the fundamentals of the Java 8 parallel streams framework.

Segment 2 How Java 8 Parallel Streams Work (40mins)

  • Instructor will describe how Java 8 parallel streams work, focusing on how
  • (1) parallel spliterator decompose tasks into subtasks
  • (2) the Java fork-join framework computes subtasks in parallel using work-stealing queues
  • (3) various collectors and/or reduction operations join the subtask results back together again.
  • Participants will learn how the Java spliterator, fork-join, and collector frameworks provide the foundation for parallel processing of Java 8 parallel streams.

Break (5 minutes)

Segment 3 Applying Java 8 Parallel Streams to several case study apps (40mins)

Segment 5 Pros and Cons of Java 8 Parallel Streams (15mins)

  • Instructor will summarize the pros and cons of Java 8 parallel streams, focusing how to successfully apply the features provided by this framework in practice.
  • Participants will learn when and how to apply Java 8 parallel streams, as well as know when not to apply Java 8 parallel streams.

Break (5 minutes)

Segment 6 Applying Java 8 Parallel Streams to ImageStreamGang App (60mins)

  • Instructor will conduct a design and code walkthrough of the ImageStreamGang app, which shows how to create a parallel program that scalably downloads, processes, and displays images from remote servers.
  • Participants will learn more advanced features of Java 8 parallel streams based on a walkthrough of the ImageStreamGang app, which is available as open-source from https://github.com/douglascraigschmidt/LiveLessons/tree/master/ImageStreamGang.

Note: this ends the metadata collection section of this guide.