RIDING THE JET STREAMS
FUAD MALIKOV | HAZELCAST
RIDING THE JET STREAMS FUAD MALIKOV | HAZELCAST JAVA 8 STREAM API - - PowerPoint PPT Presentation
RIDING THE JET STREAMS FUAD MALIKOV | HAZELCAST JAVA 8 STREAM API WHAT IS IT? JAVA 8 PRE JAVA 8 HISTORIC TIMES Collections Iterators For loops If-else statements WORD COUNT CODE Pre Java 8 Stream examples Get the unique
FUAD MALIKOV | HAZELCAST
JAVA 8 STREAM API
PRE JAVA 8 HISTORIC TIMES
▸ Collections ▸ Iterators ▸ For loops ▸ If-else statements
JAVA 8
Pre Java 8
Terminal operations
. Return concrete types or produce a side efgect. . Eagerly executed.
Function Output When to use reduce concrete type to cumulate elements collect list, map or set to group elements forEach side efgect to perform a side efgectStream examples
Get the unique surnames in uppercase of the fjrst 15 book authors that are 50 years old or over. library.stream() .map(book -> book.getAuthor()) .fjlter(author -> author.getAge() >= 50) .distinct() .limit(15) .map(Author::getSurname) .map(String::toUpperCase) .collect(toList()); Compute the sum of ages of all female authors younger than 25. library.stream() .map(Book::getAuthor) .fjlter(a -> a.getGender() == Gender.FEMALE) .map(Author::getAge) .fjlter(age -> age < 25) .reduce(0, Integer::sum):Intermediate operations
. Always return streams.
Function Preserves count Preserves type Preserves. Lazily executed.
BROUGHT TO YOU BYPost Java 8
INTRODUCTION
HAZELCAST
HAZELCAST EMBEDDED
▸ Distributed ▸ Sharded ▸ Embedded ▸ Java API
HAZELCAST
HAZELCAST CLIENT-SERVER
▸ Distributed ▸ Sharded ▸ Client Driver ▸ Java API ▸ .NET, C++, Node.js
HAZELCAST
HAZELCAST
INTRODUCTION
JET
JET Distributed Streams
JET
DIRECTED ACYCLIC GRAPH ENGINE
▸ JET Compute Engine ▸ Distributed Stream ▸ Embedded ▸ DAG API ▸ Java 8 Stream API ▸ Batch and Stream Oriented ▸ Serialization
JET DAG API
JET
JET FEATURE OVERVIEW
http://bit.ly/gime_jet