19
Understand the Java Parallel Image StreamGang Structure & Functionality Douglas C. Schmidt [email protected] www.dre.vanderbilt.edu/~schmidt Professor of Computer Science Institute for Software Integrated Systems Vanderbilt University Nashville, Tennessee, USA

Understand the Java Parallel Image StreamGang Structure

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Understand the Java Parallel Image StreamGang Structure

Understand the Java Parallel Image

StreamGang Structure & Functionality

Douglas C. [email protected]

www.dre.vanderbilt.edu/~schmidt

Professor of Computer Science

Institute for Software

Integrated Systems

Vanderbilt University

Nashville, Tennessee, USA

Page 2: Understand the Java Parallel Image StreamGang Structure

2

Learning Objectives in this Part of the Lesson• Understand the structure & functionality of the ImageStreamGang app

• It applies several Java parallelism frameworks

• Focus is on integrating object-oriented & functional programming paradigms

This design shows the synergy between object-oriented & functional programming

Page 3: Understand the Java Parallel Image StreamGang Structure

3Patterns are used to emphasize key roles & responsibilities in the app’s design

Learning Objectives in this Part of the Lesson• Understand the structure & functionality of the ImageStreamGang app

• It applies several Java parallelism frameworks

• Focus is on integrating object-oriented & functional programming paradigms

Page 4: Understand the Java Parallel Image StreamGang Structure

4

The Structure of the ImageStreamGang App

Page 5: Understand the Java Parallel Image StreamGang Structure

5

The Structure of the ImageStreamGang App• UML class diagram for the object-oriented ImageStreamGang app design

See en.wikipedia.org/wiki/Unified_Modeling_Language

Page 6: Understand the Java Parallel Image StreamGang Structure

6

• UML class diagram for the object-oriented ImageStreamGang app design

These classes apply Java features to image downloading & processing

The Structure of the ImageStreamGang App

Page 7: Understand the Java Parallel Image StreamGang Structure

7

• UML class diagram for the object-oriented ImageStreamGang app design

A framework for initiating streams that process input from a list of elements

The Structure of the ImageStreamGang App

Page 8: Understand the Java Parallel Image StreamGang Structure

8Customizes the StreamGang framework to download & process images …

• UML class diagram for the object-oriented ImageStreamGang app design

The Structure of the ImageStreamGang App

Page 9: Understand the Java Parallel Image StreamGang Structure

9

• UML class diagram for the object-oriented ImageStreamGang app design

… based on different Java concurrency & parallelism frameworks

The Structure of the ImageStreamGang App

Page 10: Understand the Java Parallel Image StreamGang Structure

10

• UML class diagram for the object-oriented ImageStreamGang app design

Uses Java streams to download & filter images sequentially

The Structure of the ImageStreamGang App

Page 11: Understand the Java Parallel Image StreamGang Structure

11

• UML class diagram for the object-oriented ImageStreamGang app design

Uses Java parallel streams to download & filter images concurrently

The Structure of the ImageStreamGang App

Page 12: Understand the Java Parallel Image StreamGang Structure

12

• UML class diagram for the object-oriented ImageStreamGang app design

Uses Java CompletableFutures to download & filter images asynchronously

The Structure of the ImageStreamGang App

Page 13: Understand the Java Parallel Image StreamGang Structure

13Stores image meta-data & provides methods for common image-/file-related tasks

• UML class diagram for the object-oriented ImageStreamGang app design

The Structure of the ImageStreamGang App

Page 14: Understand the Java Parallel Image StreamGang Structure

14This class hierarchy applies operations to filter & store images

• UML class diagram for the object-oriented ImageStreamGang app design

The Structure of the ImageStreamGang App

Page 15: Understand the Java Parallel Image StreamGang Structure

15

• UML class diagram for the object-oriented ImageStreamGang app design

Provides the user interface for an Android app

The Structure of the ImageStreamGang App

Page 16: Understand the Java Parallel Image StreamGang Structure

16

• UML class diagram for the object-oriented ImageStreamGang app design

There’s a Java console version of ImageStreamGang that shares most of the code

The Structure of the ImageStreamGang App

Page 17: Understand the Java Parallel Image StreamGang Structure

17

Running the Image StreamGang App

Page 18: Understand the Java Parallel Image StreamGang Structure

18

Starting ImageStreamGangTestPrinting 4 results for input file 1 from fastest to slowestCOMPLETABLE_FUTURES_1 executed in 312 msecsCOMPLETABLE_FUTURES_2 executed in 335 msecsPARALLEL_STREAM executed in 428 msecsSEQUENTIAL_STREAM executed in 981 msecs

Printing 4 results for input file 2 from fastest to slowestCOMPLETABLE_FUTURES_2 executed in 82 msecsCOMPLETABLE_FUTURES_1 executed in 83 msecsPARALLEL_STREAM executed in 102 msecsSEQUENTIAL_STREAM executed in 251 msecsEnding ImageStreamGangTest

Running the ImageStreamGang App

ImageStreamGang

Tests conducted on a 2.6 GHz six-core Lenovo P52 with 64 Gbytes of RAM

Page 19: Understand the Java Parallel Image StreamGang Structure

19

End of Understand the Java Parallel ImageStreamGangStructure & Functionality